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