I am newbie at vba and I am trying to get my vlookup using a macro to only return the NA# with the lookup value it used in another sheet. My goal then is too loop it so can do that through 1000's of rows. I first tried a "find" but my lookupvalues have //.. so "find" does not work but here is the vlookup macro I have:
Sub Macro2()
Dim Res As Variant
lookupval = Worksheets("Sheet1").Range("A1").Value
lookuprng = Worksheets("Sheet2").Range("A:B").Value
Res = Application.VLookup(lookupval, lookuprng, 1, False)
If IsError(Res) = False Then
Else
lookupval.Copy
Sheets("Compare Result").Range("A1").Select
ActiveSheet.Paste
End If
End Sub
Sub Macro2()
Dim Res As Variant
lookupval = Worksheets("Sheet1").Range("A1").Value
lookuprng = Worksheets("Sheet2").Range("A:B").Value
Res = Application.VLookup(lookupval, lookuprng, 1, False)
If IsError(Res) = False Then
Else
lookupval.Copy
Sheets("Compare Result").Range("A1").Select
ActiveSheet.Paste
End If
End Sub