I would be greatful if someone can help me with line six of my code I just can't get it to work,. I'm trying to use VBA to do a lookup on sheet 3, I get the error "unable to get the vlookup property of the worksheetfunction class" which sadly dosen't mean much to me.
Private Sub Galley_Click()
Dim Team As Integer
If Galley.Value = True Then
Team = InputBox("Enter Team Number")
'Range("a21").Value = Team
Range("sheet1!D6") = Application.WorksheetFunction.VLookup(Team, ("sheet3!E20:H25"), 3, False)
Range("C6").Value = Now()
Range("C7").Value = ""
Range("B6").Value = "Search in Progress"
Range("B6").Interior.ColorIndex = 6
Range("B6").Font.ColorIndex = 1
Else
Range("C7").Value = Now()
Range("B6").Value = Range("C7").Value - Range("C6")
Range("B6").Interior.ColorIndex = 0
Range("B6").Font.ColorIndex = 1
If Range("B6").Value > 0 Then
Range("A6").Interior.ColorIndex = 43
Range("A6").Font.ColorIndex = 1
End If
End If
End Sub
Many thanks
Mike
Private Sub Galley_Click()
Dim Team As Integer
If Galley.Value = True Then
Team = InputBox("Enter Team Number")
'Range("a21").Value = Team
Range("sheet1!D6") = Application.WorksheetFunction.VLookup(Team, ("sheet3!E20:H25"), 3, False)
Range("C6").Value = Now()
Range("C7").Value = ""
Range("B6").Value = "Search in Progress"
Range("B6").Interior.ColorIndex = 6
Range("B6").Font.ColorIndex = 1
Else
Range("C7").Value = Now()
Range("B6").Value = Range("C7").Value - Range("C6")
Range("B6").Interior.ColorIndex = 0
Range("B6").Font.ColorIndex = 1
If Range("B6").Value > 0 Then
Range("A6").Interior.ColorIndex = 43
Range("A6").Font.ColorIndex = 1
End If
End If
End Sub
Many thanks
Mike