ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Copying Macro w/ different sheets (https://www.excelbanter.com/excel-worksheet-functions/78813-copying-macro-w-different-sheets.html)

liseladele

Copying Macro w/ different sheets
 

I need help with a macro.

I have 5 columns and 75 rows that need a Vlookup function in them.
Each column will be using a different sheet for the Vlookup and each
row will need a differnent column # to retrieve the data. Is there a
macro I can set up to input this data??

Thanks,

Lisel


--
liseladele
------------------------------------------------------------------------
liseladele's Profile: http://www.excelforum.com/member.php...o&userid=32688
View this thread: http://www.excelforum.com/showthread...hreadid=525069


Max

Copying Macro w/ different sheets
 
Perhaps a formulas approach using INDIRECT to grab
the table_array from the reference sheet would also be feasible ?

Sample construct is available at:
http://www.savefile.com/files/3504820
Vlookup different sheets n different col nums

Assume 3 reference sheets: X, Y, Z
where cols A to G contain lookup data
with col A = lookup values
data from row1 down

In another sheet: Summ,

Ref sheetnames are listed across in B1:C1, eg: X, Y, Z
(vlookup) Col #'s are listed in B2:C2 across, eg: 2, 7, 3
Lookup values are in A3 down

To retrieve the necessary from each reference sheet
for the lookup values in col A,

we could put in B3:
=VLOOKUP($A3,INDIRECT("'"&B$1&"'!A:G"),B$2,0)
and copy B3 across to D3, fill down to populate

Adapt/extend to suit ..
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"liseladele" wrote
in message ...

I need help with a macro.

I have 5 columns and 75 rows that need a Vlookup function in them.
Each column will be using a different sheet for the Vlookup and each
row will need a differnent column # to retrieve the data. Is there a
macro I can set up to input this data??

Thanks,

Lisel


--
liseladele
------------------------------------------------------------------------
liseladele's Profile:

http://www.excelforum.com/member.php...o&userid=32688
View this thread: http://www.excelforum.com/showthread...hreadid=525069





All times are GMT +1. The time now is 12:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com