How can I change an image based on cell value

  • Thread starter Thread starter Adriaan vd Linde
  • Start date Start date
A

Adriaan vd Linde

I want to place a picture of the employee on a Rating form
and it must change based on the employee's name selected
from a dropdown combo list box.

Thanks

Adriaan
 
OK,

this is what ya gotta do.

Make the for with the combobox and image control.


Private Sub UserForm_Initialize()
ComboBox1.List = Range("a1:a4").Value ' your range. this will load the
combobox with the names
End Sub



Private Sub ComboBox1_Change()
Image1.Picture = LoadPicture("C:\My Documents\My Pictures\" & ComboBox1.Text
& ".bmp") ' put your path there and the extension. bmp or gif.


End Sub



hope it helps.




Cesar Zapata
 
Back
Top