0

I keep getting this error saying object doesn't support property or method when I run this bit of my code.

Any ideas how to get it to work?

If ActiveCell.Value <> WorksheetFunction.VLookup(ActiveCell.Offset(0, 1), Workbooks("Log.xls").Worksheets("Log").Range("A:B"), 2, False) Then
    [f2].Value = vvvv

End If
BigBen
  • 46,229
  • 7
  • 24
  • 40
Mazen
  • 1
  • 1
  • 1
    No repro - the error message isn't "Unable to get the Vlookup property of the WorksheetFunction class"? – BigBen Feb 28 '20 at 16:44
  • 1
    Where is the code? (i.e. is it in a module, class, worksheet...) – Zac Feb 28 '20 at 16:49

1 Answers1

-2

Try this:

If ActiveCell.Value <> Application.VLookup(CStr(ActiveCell.Offset(0, 1)), Worksheets("Sheet1").Range("A:B"), 2, False) Then
        [f2].Value = vvvv

End If

More details: You must control the type of the lookup value in VLOOKUP function

Marlond25
  • 77
  • 4