LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
jer jer is offline
external usenet poster
 
Posts: 25
Default vlookup error 2042

The following works fine (with the help of the newsgroup I have been able to
modify some code)
If Not IsError(cyclookupValueB) And _
cell.Offset(0, 1) = "BUY" And _
cell.Offset(0, 3) = "INV" Then
cell.Offset(0, 6) = cyclookupValueB
ElseIf Not IsError(cyclookupValueS) And _
cell.Offset(0, 1) = "SAL" And _
cell.Offset(0, 3) = "CNR" Then
cell.Offset(0, 6) = cyclookupValueS

with these variables

cyclookupValueB = _
Application.VLookup(cell.Value, cycRange, 2, False)
cyclookupValueS = _
Application.VLookup(cell.Value, cycRange, 3, False)

not sure if the below is possible, however if I include the following

ElseIf Not IsError(cyclookupValueB) And _
cell.Offset(0, 1) = "BUY" And _
cell.Offset(0, 6) = cyclookupValueM Then
cell.Offset(0, 6) = cyclookupValueB
ElseIf Not IsError(cyclookupValueS) And _
cell.Offset(0, 1) = "SAL" And _
cell.Offset(0, 6) = cyclookupValueM Then
cell.Offset(0, 6) = cyclookupValueS

with the following variable
cyclookupValueM = _
Application.VLookup(cell.Value, cycRange, 6, False)

I am getting error 2042. Any suggesstions/assistance

--
thanks as always for the help
 
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 IS ERROR PAL Excel Worksheet Functions 3 May 7th 10 08:28 AM
VLOOKUP ERROR DeVoe Excel Worksheet Functions 3 April 11th 07 09:11 PM
Excel xlodbc error 2042 with SQLRetrieve ALK[_2_] Excel Programming 0 July 28th 05 03:05 PM
Vlookup Error mick.smith1964 Excel Worksheet Functions 5 January 13th 05 10:03 PM
Error 2042 Barbara[_3_] Excel Programming 1 September 8th 03 08:16 PM


All times are GMT +1. The time now is 04:22 AM.

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

About Us

"It's about Microsoft Excel"