vba programming

S

sal

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 (e-mail address removed)

Sal
 
T

Tom Ogilvy

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
 

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