Hi All,
I'm using a an excel "program" which looks up weekly information, filters and formats it. I then "move as a copy" to the previous week's file, appending it to the end as a new worksheet.
Currently I update a few columns with information about that particular entry [row]. Each week I populate those columns MANUALLY with a VLOOKUP function to the previous week's worksheet (I have to change the worksheet name each time and then drag the formula down all the rows in that column), then I copy/pastespecial values and add any new updates, or update any new entries.
What I want to do is add to the program a way to populate these columns with the formula automatically - finding the name of the previous week's worksheet is not a problem.
What I have found though is that when it populates a VLOOKUP formula, it immediately opens a window for me to browse to the file where the worksheet is contained, since it doesn't exist in the program's workbook.
I would really appreciate it if someone could help me with this. I'm hoping that there's some sort of format or option which can be set which prevents the program looking for the specified worksheet if it's not in the workbook... or maybe there's another way to do it?
In case it helps, here's the formula I use:
=IF(ISERROR(VLOOKUP($C3,'4QTRWk04'!$C$3:$X$201,19,FALSE)),"",IF(VLOOKUP($C3,'4QTRWk04'!$C$3:$X$201,19,FALSE)="","",VLOOKUP($C3,'4QTRWk04'!$C$3:$X$201,19,FALSE)))
So it's looking up the 4QTR worksheet from Wk04, matching column
C and returning what is in column 19.
And I would just use this piece of VBA code to put it in a cell and copy it down:
Range("V2").Select
ActiveCell.Formula = "=IF(ISERROR(VLOOKUP($C3,'4QTRWk04'!$C$3:$X$201,19,FALSE)),"",IF(VLOOKUP($C3,'4QTRWk04'!$C$3:$X$201,19,FALSE)="","",VLOOKUP($C3,'4QTRWk04'!$C$3:$X$201,19,FALSE)))"
Selection.Copy
Range("V3:V" & LastRow).Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False