Thread: vba programming
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default vba programming

Private Sub Combobox1_Click()
ActiveCell.Value = Combobox1.Value
Select Case Combobox1.Value
Case "Item1"
image1.picture = LoadPicture("C:\My Pictures\myface.jpg")
Case "Item2"
image1.picture = LoadPicture("C:\My Pictures\myneck.jpg")
Case Else
image1.picture = LoadPicture("C:\My Pictures\myfinger.jpg")
End Select
End Sub

--
Regards,
Tom Ogilvy


"sal" wrote in message
om...
Hi I have 2 questions which I can't figure out.
1. when creating a combo box in excel using visual basics userform1,
how do I enter the item of the item selected into an active cell. Ie.
if I select cell b5 and then from the combo list I click on "sal" I
want "sal" to appear in cell "b5"

Also from the userform1 I want a picture to appear in the image1
depending on what I highlight or click from my combo box.

Thanks in advance
If you reply direct please send to

Sal