I'm trying to learn a bit of VBA, and am hoping someone can explain something for me
I'm running a vlookup in VBA that takes a numeric index and returns the corresponding name from worksheet range. If I pass this index as a Variant the function fails, but if I pass an Integer it succeeds. However, if I change the underlying range data from numeric to alphanumeric (e.g., from 1 to 1a) the Variant argument works.
Why does does vlookup fail when a Variant argument is received and the underlying data is numeric?
I have a worksheet that looks like this:

This lookup function works perfectly
Sub LookupTest()
Dim LookupValue As Integer
Dim ReturnValue As Variant
LookupValue = InputBox("Enter a value to lookup")
Sheets("Sheet1").Activate
ReturnValue = WorksheetFunction.VLookup(LookupValue, Range("A1:B4"), 2, False)
MsgBox (ReturnValue)
End Sub
But this one fails:
Sub LookupTest()
Dim LookupValue As Variant
Dim ReturnValue As Variant
LookupValue = InputBox("Enter a value to lookup")
Sheets("Sheet1").Activate
ReturnValue = WorksheetFunction.VLookup(LookupValue, Range("A1:B4"), 2, False)
MsgBox (ReturnValue)
End Sub