View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Mike H. Mike H. is offline
external usenet poster
 
Posts: 471
Default Error 1004 in WorksheetFunction.VLookup

I should have known! I have only used this
application.worksheetfunction.vlookup one other time and kept thinking it was
something with my naming the range or something. But it is just the fact
that the data in one place is a number and in the other is text. I should
have figured that out. Thanks for being there for me. I just spent the last
1.5 hours trying to figure what was wrong withe code. When all along, I just
had a loose nut on the keyboard!


"Bob Phillips" wrote:

Try

Stats = Application.WorksheetFunction.VLookup(112001, LookLU2, 2, False)


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Mike H." wrote in message
...
Runtime error 1004.
Unable to get the vlookup property from the worksheetfunction class!


"dan dungan" wrote:

what is the error message?


On Oct 4, 9:48 am, Mike H. wrote:
What could POSSIBLY be causing the error 1004 on this code:

Dim LookLU2 as Range
Dim Stats as Variant

Set LookLU2 = Workbooks("PRProc.xls").Names("StatsAcc").RefersTo Range
Stats = Application.WorksheetFunction.VLookup("112001", LookLU2, 2,
False)

The file is open, the lookup works when I do it manually. I don't get
it.
Any ideas?