Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 471
Default Error 1004 in WorksheetFunction.VLookup

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 411
Default Error 1004 in WorksheetFunction.VLookup

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?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 471
Default Error 1004 in WorksheetFunction.VLookup

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?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Error 1004 in WorksheetFunction.VLookup

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?






  #5   Report Post  
Posted to microsoft.public.excel.programming
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?






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
worksheetfunction.vlookup error Larry Levinson Excel Programming 15 August 6th 05 12:41 AM
Worksheetfunction.vlookup and #value error BL Excel Worksheet Functions 2 June 17th 05 09:48 PM
Error '1004' in WorksheetFunction oakman[_16_] Excel Programming 0 November 18th 04 01:48 PM
Error '1004' in WorksheetFunction oakman[_15_] Excel Programming 1 November 17th 04 08:16 PM
Error '1004' in WorksheetFunction oakman[_14_] Excel Programming 1 November 17th 04 03:56 PM


All times are GMT +1. The time now is 07:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"