adding vlookup into Macro and table_array is different every week.

C

cupertino

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. sam
as file 2,3 & 4.

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

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

Thank you
 
D

Don Guillett

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.

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top