LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Calling variable files


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling name of Sheet as a Variable? thekeytothedoor Excel Worksheet Functions 1 January 1st 10 08:48 AM
Calling a variable macro Hari Prasadh[_2_] Excel Programming 2 July 30th 05 09:28 AM
Calling a sub with a variable... Gary Phillips[_2_] Excel Programming 1 July 13th 04 10:25 PM
Calling variable file name Michael[_12_] Excel Programming 2 September 16th 03 03:51 PM
saveas calling a variable Douvid Excel Programming 6 July 28th 03 08:46 AM


All times are GMT +1. The time now is 01:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"