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


I get error 1004; "Unable to get the VLookup property of the
WorksheetFunction class" on the following line of code:

-myHoliday = Application.WorksheetFunction.VLookup(myDate,
Worksheets("Supporting Sheet").Range("PayPeriod"), 3)-

I'm running Excel 2002. Any suggestions?


--
ricm9
------------------------------------------------------------------------
ricm9's Profile: http://www.excelforum.com/member.php...o&userid=34613
View this thread: http://www.excelforum.com/showthread...hreadid=543865

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 186
Default VLookup error

Hi,
When I have used VLOOKUP in VB, I use the following:

Range("A1") = "=VLookup(MyDate, 'Supporting Sheet'!PayPeriod, 3)"

You might try that code.
--
Ken Hudson


"ricm9" wrote:


I get error 1004; "Unable to get the VLookup property of the
WorksheetFunction class" on the following line of code:

-myHoliday = Application.WorksheetFunction.VLookup(myDate,
Worksheets("Supporting Sheet").Range("PayPeriod"), 3)-

I'm running Excel 2002. Any suggestions?


--
ricm9
------------------------------------------------------------------------
ricm9's Profile: http://www.excelforum.com/member.php...o&userid=34613
View this thread: http://www.excelforum.com/showthread...hreadid=543865


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default VLookup error

You'll get that error if VLOOKUP doesn't find a match. Instead,
use

Dim myHoldiday As Variant
myHoliday = Application.VLookup(myDate, _
Worksheets("Supporting Sheet").Range("PayPeriod"), 3)-
If IsError(myHoliday) = True Then
' not found
End IF


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com





"ricm9"
wrote in message
...

I get error 1004; "Unable to get the VLookup property of the
WorksheetFunction class" on the following line of code:

-myHoliday = Application.WorksheetFunction.VLookup(myDate,
Worksheets("Supporting Sheet").Range("PayPeriod"), 3)-

I'm running Excel 2002. Any suggestions?


--
ricm9
------------------------------------------------------------------------
ricm9's Profile:
http://www.excelforum.com/member.php...o&userid=34613
View this thread:
http://www.excelforum.com/showthread...hreadid=543865



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VLookup error


Now I get error 2042. What does this error mean?

I have adjusted the values such that there will always be a match, bu
that doesn't seem to help.

Here is the action I want:
Given a supplied date value, I am trying to find the row who's dat
matches in column 'A', and then return a corresponding value in colum
'C'.

What a I doing wrong

--
ricm
-----------------------------------------------------------------------
ricm9's Profile: http://www.excelforum.com/member.php...fo&userid=3461
View this thread: http://www.excelforum.com/showthread.php?threadid=54386

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default VLookup error

A 2042 error is the same as #N/A error. It means VLOOKUP didn't
find what it was looking for. You might have numbers formatted as
text or special characters in the cell.



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"ricm9"
wrote in message
...

Now I get error 2042. What does this error mean?

I have adjusted the values such that there will always be a
match, but
that doesn't seem to help.

Here is the action I want:
Given a supplied date value, I am trying to find the row who's
date
matches in column 'A', and then return a corresponding value in
column
'C'.

What a I doing wrong?


--
ricm9
------------------------------------------------------------------------
ricm9's Profile:
http://www.excelforum.com/member.php...o&userid=34613
View this thread:
http://www.excelforum.com/showthread...hreadid=543865



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
vlookup error Scott@CW Excel Discussion (Misc queries) 4 September 19th 07 05:54 PM
VLOOKUP error Solitary Excel Worksheet Functions 3 September 14th 07 02:30 PM
vlookup #N/A error tmurcer Excel Discussion (Misc queries) 2 May 18th 06 05:10 PM
REF# error using VLOOKUP Amy Excel Worksheet Functions 8 May 18th 06 01:06 AM
VLookup N/A Error WandaSG Excel Discussion (Misc queries) 5 December 12th 05 07:48 PM


All times are GMT +1. The time now is 09:15 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"