Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to pass arguments to vlookup in VBA
Could some one pls tell me how to go about this ??? xtenv = activecell.value ActiveCell.Offset(0, 2).Formula = "=VLOOKUP(xtenv,CODE,2,FALSE)" I want to automatically lookup values in the active cell however the above command does not get me the right answer... where could i be wrong thanks -- mathewg ------------------------------------------------------------------------ mathewg's Profile: http://www.excelforum.com/member.php...o&userid=30646 View this thread: http://www.excelforum.com/showthread...hreadid=503225 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to pass arguments to vlookup in VBA
try this and see if it works
ActiveCell.Offset(0, 2).Formula = "=VLOOKUP(" & xtenv & ",CODE,2,FALSE)" -- Gary "mathewg" wrote in message ... Could some one pls tell me how to go about this ??? xtenv = activecell.value ActiveCell.Offset(0, 2).Formula = "=VLOOKUP(xtenv,CODE,2,FALSE)" I want to automatically lookup values in the active cell however the above command does not get me the right answer... where could i be wrong thanks -- mathewg ------------------------------------------------------------------------ mathewg's Profile: http://www.excelforum.com/member.php...o&userid=30646 View this thread: http://www.excelforum.com/showthread...hreadid=503225 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to pass arguments to vlookup in VBA
sorry, forgot the quotes
ActiveCell.Offset(0, 2).Formula = "=VLOOKUP(" & """" & xtenv & """" & ",CODE,2,FALSE)" -- Gary "mathewg" wrote in message ... Could some one pls tell me how to go about this ??? xtenv = activecell.value ActiveCell.Offset(0, 2).Formula = "=VLOOKUP(xtenv,CODE,2,FALSE)" I want to automatically lookup values in the active cell however the above command does not get me the right answer... where could i be wrong thanks -- mathewg ------------------------------------------------------------------------ mathewg's Profile: http://www.excelforum.com/member.php...o&userid=30646 View this thread: http://www.excelforum.com/showthread...hreadid=503225 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to pass arguments to vlookup in VBA
the code is all 1 line, so watch the word wrap
-- Gary "Gary Keramidas" <GKeramidasATmsn.com wrote in message ... sorry, forgot the quotes ActiveCell.Offset(0, 2).Formula = "=VLOOKUP(" & """" & xtenv & """" & ",CODE,2,FALSE)" -- Gary "mathewg" wrote in message ... Could some one pls tell me how to go about this ??? xtenv = activecell.value ActiveCell.Offset(0, 2).Formula = "=VLOOKUP(xtenv,CODE,2,FALSE)" I want to automatically lookup values in the active cell however the above command does not get me the right answer... where could i be wrong thanks -- mathewg ------------------------------------------------------------------------ mathewg's Profile: http://www.excelforum.com/member.php...o&userid=30646 View this thread: http://www.excelforum.com/showthread...hreadid=503225 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to pass arguments to vlookup in VBA
Thanks a ton ... :) -- mathewg ------------------------------------------------------------------------ mathewg's Profile: http://www.excelforum.com/member.php...o&userid=30646 View this thread: http://www.excelforum.com/showthread...hreadid=503225 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to pass variables as arguments of a function | Excel Worksheet Functions | |||
Can I pass arguments to my formatted empty spreadsheet file? | Excel Discussion (Misc queries) | |||
Too many arguments-VLOOKUP instead? | Excel Worksheet Functions | |||
Run/execute VBS and pass arguments | Excel Programming | |||
How to pass arguments from ThisWorkbook to a UserForm | Excel Programming |