How can I change an image based on cell value

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
 
C

Cesar Zapata

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top