View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_2_] Don Guillett[_2_] is offline
external usenet poster
 
Posts: 1,522
Default 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