Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
there's one integer variable, j.
I want to use VLookup function here, and the table Array parameter should be Column j to j+1 But how to write this code in VBA? Application.VLookUp(Cells(1,1), COLUMNS(j,j+1), 2 FALSE) ??? It report erros like above. Thanks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() If you set up a Vlookup function in the spreadsheet...(un-used cell) and identify a cell to paste the lookup value... (lookup function first term) you can use Excel to do the lookup and then just "get" the value from the function cell... something like: Cells(1,1)="MyValue" Return_value=cells(1,2) where the lookup value is in cell(1,1) and the lookup formula is in cell(1,2)... -- weavtennis ------------------------------------------------------------------------ weavtennis's Profile: http://www.excelforum.com/member.php...fo&userid=3634 View this thread: http://www.excelforum.com/showthread...hreadid=514348 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try
Application.VLookUp(Cells(1,1), COLUMNS(j).Resize(,2), 2 FALSE) -- HTH Bob Phillips (remove nothere from email address if mailing direct) wrote in message oups.com... there's one integer variable, j. I want to use VLookup function here, and the table Array parameter should be Column j to j+1 But how to write this code in VBA? Application.VLookUp(Cells(1,1), COLUMNS(j,j+1), 2 FALSE) ??? It report erros like above. Thanks. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Bob, it works!
appreciated Bob Phillips 写道: Try Application.VLookUp(Cells(1,1), COLUMNS(j).Resize(,2), 2 FALSE) -- HTH Bob Phillips (remove nothere from email address if mailing direct) wrote in message oups.com... there's one integer variable, j. I want to use VLookup function here, and the table Array parameter should be Column j to j+1 But how to write this code in VBA? Application.VLookUp(Cells(1,1), COLUMNS(j,j+1), 2 FALSE) ??? It report erros like above. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
array table and vlookup | Excel Worksheet Functions | |||
VLOOKUP - 3 Table Array | Excel Worksheet Functions | |||
How to use a cell value as Table Array in VLOOKUP worksheet function | Excel Discussion (Misc queries) | |||
Naming A Table Array in Vlookup | Excel Programming | |||
Fixing table array in vlookup? | Excel Programming |