View Single Post
  #1   Report Post  
ayl322
 
Posts: n/a
Default VLookup in VBA giving error message


Hi, I'm having trouble making the vlookup function work in VBA.
the values that are used are all dates, I don't know if that makes a
difference.


Worksheets("sheet1").range("a1").value = application.WorksheetFunction.
_
Vlookup(Range("c1"), range("a:a"), 2)

this gives me a run-time error '1004' Unable to get the vlookup
property of the Worksheet function class


so i tried this:
Worksheets("sheet1").range("a1").value =
application.Vlookup(Range("c1"), _
range("a:a"), 2)

but this gives me a #REF error.

What am I doing wrong?

Any help would be appreciated!


--
ayl322
------------------------------------------------------------------------
ayl322's Profile: http://www.excelforum.com/member.php...fo&userid=9846
View this thread: http://www.excelforum.com/showthread...hreadid=390609