ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   adding vlookup into Macro and table_array is different every week. (https://www.excelbanter.com/excel-programming/366179-adding-vlookup-into-macro-table_array-different-every-week.html)

cupertino

adding vlookup into Macro and table_array is different every week.
 
Hi

I have a weekly report where I need to update column M,N,O,P

Row 1 is header.
M2 =VLOOKUP(F2,'[File1 2012-0201.xls]sheet1'!$A:$B,2,0)
N2 =VLOOKUP(F2,'[File2 2012-0201.xls]sheet1'!$A:$U,21,0)
O2 =VLOOKUP(D2,'[File3 2012-0201.xls]sheet1'!$D:$O,12,0)
P2 =VLOOKUP(D2,'[File4 2012-0201.xls]sheet1'!$D:$P,13,0)

and File1 2012-0201xls will become File1 2012-0208.xls next week. same as file 2,3 & 4.

only Table_Array is different every week, rest of the formula is the same.

How do I add this into my macro where it will pause and ask me for the file location & Name (Table_Array) when I run it?

Thank you.

Don Guillett[_2_]

adding vlookup into Macro and table_array is different every week.
 
On Feb 1, 5:56*pm, cupertino
wrote:
Hi

I have a weekly report where I need to update column M,N,O,P

Row 1 is header.
M2 =VLOOKUP(F2,'[File1 2012-0201.xls]sheet1'!$A:$B,2,0)
N2 =VLOOKUP(F2,'[File2 2012-0201.xls]sheet1'!$A:$U,21,0)
O2 =VLOOKUP(D2,'[File3 2012-0201.xls]sheet1'!$D:$O,12,0)
P2 =VLOOKUP(D2,'[File4 2012-0201.xls]sheet1'!$D:$P,13,0)

and File1 2012-0201xls will become File1 2012-0208.xls next week. same
as file 2,3 & 4.

only Table_Array is different every week, rest of the formula is the
same.

How do I add this into my macro where it will pause and ask me for the
file location & Name (Table_Array) when I run it?

Thank you.

--
cupertino


Record a macro after either selecting or referring to all and then
use
editreplacereplace the old with the new. If you still can't get it,
send me your file
dguillett1 @gmail.com


All times are GMT +1. The time now is 09:20 PM.

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