#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 17
Default Vlookup error

Hello,

I've got a Vlookup formula that when I execute it, it totally changes
the lookup array. I entered the range "Cusip" as the lookup array in
the VBE but it shows up as "CorpA" in the spreadsheet. What am I doing
wrong?

VBE:

Corp.Range("BC4").Resize(DataRow, 1).FormulaR1C1 = "=VLOOKUP(RC[-50],"
& Cusip.Address(external:=True, ReferenceStyle:=xlR1C1) & ",3,FALSE)

Spreadsheet:

=VLOOKUP(E12,CorpA!$A$1:$D$2027,4,FALSE)

Thanks,
Wes
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 420
Default Vlookup error

Cusip is a range variable in your code. If that variable is pointing to
A1:D2027 on the CorpA worksheet, then your code is doing things exactly correctly.

If you think that Cusip should be pointing to a different range on a different
worksheet, then that's the part of the code that you'll need to share.

For instance, if Cusip should be pointing at the same worksheet that contains
the formula, then you'd want something like:

set Cusip = Corp.range("a1:d2027")

But it's difficult to guess...

On 10/01/2011 14:43, wesley holtman wrote:
Hello,

I've got a Vlookup formula that when I execute it, it totally changes
the lookup array. I entered the range "Cusip" as the lookup array in
the VBE but it shows up as "CorpA" in the spreadsheet. What am I doing
wrong?

VBE:

Corp.Range("BC4").Resize(DataRow, 1).FormulaR1C1 = "=VLOOKUP(RC[-50],"
& Cusip.Address(external:=True, ReferenceStyle:=xlR1C1)& ",3,FALSE)

Spreadsheet:

=VLOOKUP(E12,CorpA!$A$1:$D$2027,4,FALSE)

Thanks,
Wes


--
Dave Peterson
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 #N/A Abdul Excel Discussion (Misc queries) 4 November 4th 08 01:45 PM
Vlookup value not available error [email protected] Excel Discussion (Misc queries) 1 December 30th 06 10:44 PM
vlookup error Jim Excel Worksheet Functions 1 January 25th 06 09:49 PM
VLookup N/A Error WandaSG Excel Discussion (Misc queries) 5 December 12th 05 08:48 PM
vlookup error Micayla Bergen Excel Discussion (Misc queries) 2 May 27th 05 02:35 AM


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