Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, I have a master workbook which opens several files and pulls data out, this all works fine. The filenames it pulls from are hard coded into the macro. I need these to be flexable cause the filenames change ocasionally. Soo what i am looking for is to add a sheet on my master workbook with names of files. The macro will then target a cell for the filename to pull data from instead of hard coding. IE: Instead of hardcoding "TestNumber1.xls" this filename will be in a cell on sheet2 of the MasterWorkBook, something like "MasterWorkBook/Sheet2/A1" Anyone have any clues on how to do this? Or a better way? Code: -------------------- 'This is copying workbook # 1 Workbooks.Open ThisWorkbook.Path & "\TestNumber1.xls" LastRow = Range("A65536").End(xlUp).Row Range("A" & LastRow).EntireRow.Copy Windows("MasterWorkBook.xls").Activate Range("A4").Select ActiveSheet.Paste Windows("TestNumber1.xls").Activate Application.CutCopyMode = False ActiveWindow.Close -------------------- -- Ruckus ------------------------------------------------------------------------ Ruckus's Profile: http://www.excelforum.com/member.php...o&userid=27130 View this thread: http://www.excelforum.com/showthread...hreadid=466463 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Calling name of Sheet as a Variable? | Excel Worksheet Functions | |||
Calling a variable macro | Excel Programming | |||
Calling a sub with a variable... | Excel Programming | |||
Calling variable file name | Excel Programming | |||
saveas calling a variable | Excel Programming |