View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
JMay JMay is offline
external usenet poster
 
Posts: 468
Default Can I show a picture depending on what data is selected in a cell

Create yourself a Userform, named Userform1 and in the code window behind the
Userform paste in:

Private Sub ComboBox1_Change()
Image1.Picture = LoadPicture("C:\CLIPART\PHOTOS\OFFICE\" & ComboBox1.Value &
".jpg") ' <<change to suit !!
End Sub

Private Sub UserForm_Initialize()
Dim i As Long
Dim Vlist As Variant
Vlist = Array("Computer", "Coffee", "Keyboard") 'Change to the Actual
Filename
For i = LBound(Vlist) To UBound(Vlist)
ComboBox1.AddItem Vlist(i)
Next i
End Sub

Also create (Using the Control Toolbox type) a combobox on the Userform,
named combobox1;


That should get you started...

Jim



"Lesley Murray" wrote:

I would like to show a jpeg picture representing the data that is selected
from a dropdown list. If the value changes, I would like the picture to
change.