Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 88
Default vlook on different tabs based on value

good day,

i have the following so far in my macro:

....
supcode = Range("B4").Value
....
If supcode = "CLI" Then
ActiveCell.Offset(0, 4) = "=VLOOKUP(RC[-4], '[Order
Generator.xlsm]CLI'!C2:C4,2,FALSE)"
....

right now i have this code repeated several times for each supcode that may
exist and i am usingn an if statement for each possible "supcode". i would
like to replace all the if statements, and change the "CLI" to use the
"supcode" value.

how do i get the "supcode" value into the vlookup code?

thank you,

jat
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 457
Default vlook on different tabs based on value

'All on one line
ActiveCell.Offset(0, 4) = "=VLOOKUP(RC[-4], '[Order Generator.xlsm]" &
supcode & "'!C2:C4,2,FALSE)"

--
Best Regards,

Luke M
"jatman" wrote in message
...
good day,

i have the following so far in my macro:

...
supcode = Range("B4").Value
...
If supcode = "CLI" Then
ActiveCell.Offset(0, 4) = "=VLOOKUP(RC[-4], '[Order
Generator.xlsm]CLI'!C2:C4,2,FALSE)"
...

right now i have this code repeated several times for each supcode that
may
exist and i am usingn an if statement for each possible "supcode". i
would
like to replace all the if statements, and change the "CLI" to use the
"supcode" value.

how do i get the "supcode" value into the vlookup code?

thank you,

jat



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
VLOOK ups accross Multiple Tabs Kyaba New Users to Excel 1 June 18th 09 05:00 AM
Vlookup Different tabs based on Dates andy Excel Worksheet Functions 5 April 23rd 09 04:53 PM
VLOOK-pivot table expanding want to update vlook automatically CrimsonPlague29 Excel Worksheet Functions 0 August 8th 07 09:44 PM
VLOOK-pivot table expanding want to update vlook automatically CrimsonPlague29 Excel Worksheet Functions 0 August 8th 07 09:44 PM
How can I name Worksheet Tabs based on some king of reference? Gord Dibben Excel Worksheet Functions 4 August 1st 07 10:52 PM


All times are GMT +1. The time now is 12:14 AM.

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"