What I'm trying to do is have it that when you click a command button ("CommandButton1" name will be changed later on tongue.gif), it looks up a value on the work sheet "TimeTable" and changes the caption ("Label1" again will change it tongue.gif) on the form "UserForm1".

What I have is some simple code:
CODE
Private Sub CommandButton1_Click()

Label1.Caption = Application.WorksheetFunction.VLookup("Gateway Plaza", "C3:C26", 1, False)

End Sub


At first I kept getting "Run time error 13" but I added "WorksheetFunction" and then I started getting "Run time error 1004: Unable to get the Vlookup property of the WorksheetFunction Class"

How do I fix it?

Edit: Haha, I didn't need to use Vlookup laugh.gif All I had to do was:
Label1.Caption = Range("C3") laugh.gif

Close topic please tongue.gif

 

 

 


Reply