Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
vlookup error | Excel Discussion (Misc queries) | |||
VLOOKUP error | Excel Worksheet Functions | |||
vlookup #N/A error | Excel Discussion (Misc queries) | |||
REF# error using VLOOKUP | Excel Worksheet Functions | |||
VLookup N/A Error | Excel Discussion (Misc queries) |