Help required. I've got a date in Sheet 1 A1 that I'm looking up in Sheet b. The date is in the column but the lookup fails to recognise it.
Any ideas, pls
Sub Example_of_Vlookup()
Dim lookFor As Range
Dim rng As Range
Dim col As Integer
Dim found As Variant
Set lookFor = Sheets("Sheet1").Range("A1")
Set rng = Sheets("b").Columns("A:B")
col = 2
On Error Resume Next
found = Application.WorksheetFunction.VLookup(lookFor.Value, rng, col, 0)
If IsError(found) Then
MsgBox lookFor & " not found"
Else: MsgBox "The look-up value of " & lookFor & " is " & found & " in column " & col
End If
On Error GoTo 0
End Sub
Any ideas, pls
Sub Example_of_Vlookup()
Dim lookFor As Range
Dim rng As Range
Dim col As Integer
Dim found As Variant
Set lookFor = Sheets("Sheet1").Range("A1")
Set rng = Sheets("b").Columns("A:B")
col = 2
On Error Resume Next
found = Application.WorksheetFunction.VLookup(lookFor.Value, rng, col, 0)
If IsError(found) Then
MsgBox lookFor & " not found"
Else: MsgBox "The look-up value of " & lookFor & " is " & found & " in column " & col
End If
On Error GoTo 0
End Sub