Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Vlookup help
Hello. I can't seem to get the below formula to work. Conceptually, I need
the Col_Index_Num field in the vlookup formula to be the current column + 3 - the value in cell C2. When I run the line below, I get a Sub or Function not Defined error on Column(). So I'm guessing Column() is a worksheet function and not vba code. Any ideas on how I can switch around? Thanks! ActiveCell.Formula = _ "=VLOOKUP($A$4,Data!$A$7:$Q$1000," & Column() + 3 - Range("C2").Value & ",0)" |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Vlookup help
ActiveCell.Column + 3 - Range("C2")
HTH Die_Another_Day Steph wrote: Hello. I can't seem to get the below formula to work. Conceptually, I need the Col_Index_Num field in the vlookup formula to be the current column + 3 - the value in cell C2. When I run the line below, I get a Sub or Function not Defined error on Column(). So I'm guessing Column() is a worksheet function and not vba code. Any ideas on how I can switch around? Thanks! ActiveCell.Formula = _ "=VLOOKUP($A$4,Data!$A$7:$Q$1000," & Column() + 3 - Range("C2").Value & ",0)" |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Vlookup help
That is correct, column() is a worksheet formula.
One Possibility ActiveCell.Formula = _ "=VLOOKUP($A$4,Data!$A$7:$Q$1000,Column() + 3 -" & Range("C2").Value & ",0)" or: ActiveCell.Formula = _ "=VLOOKUP($A$4,Data!$A$7:$Q$1000," & _ activecell.column + 3 - Range("C2").Value & ",0)" -- Regards, Tom Ogilvy "Steph" wrote in message ... Hello. I can't seem to get the below formula to work. Conceptually, I need the Col_Index_Num field in the vlookup formula to be the current column + 3 - the value in cell C2. When I run the line below, I get a Sub or Function not Defined error on Column(). So I'm guessing Column() is a worksheet function and not vba code. Any ideas on how I can switch around? Thanks! ActiveCell.Formula = _ "=VLOOKUP($A$4,Data!$A$7:$Q$1000," & Column() + 3 - Range("C2").Value & ",0)" |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
If (Vlookup 0) working, but what if Vlookup cell does not exist | Excel Worksheet Functions | |||
VLookUp - Does the VLookUp return the exact information? | Excel Worksheet Functions | |||
Vlookup in vlookup - taking the result as array name | Excel Worksheet Functions | |||
Combine VLOOKUP and IF function so #NA isn't returned as a value from VLOOKUP | Excel Discussion (Misc queries) | |||
Vlookup info being used without vlookup table attached? | Excel Worksheet Functions |