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: 48
Default Change a Macro commands reference to file locations

The following Macro works fine as long as I don't change the location of the
template files. when I copy the blank folder to the weekly folder at say,
C:\Documents and Settings\Tom\Desktop\CHARTER\WK 15 or on a different
machine at C:\Documents and Settings\All Users\Documents\CHARTER\WK 15 I lose
the ability in my
macro to open the WK 15 files. It becomes more complicated in that I use
Microsofts Groove Networks to form a file sharing workspace between offices
and my laptop so when ever I need a local office to run the macro I have to
go in and edit each macro for the right location and because I have 14 Macros
for each week it becomes tedious to setup and maintain. The following is
just one of many lines of code that use the file location. I know I could set
up a C:/Data folder structure on every computer but I was rather hoping I
could tell the Macro to be flexible. My initial thought was that if I saved
the Macro in the workbook instead of personal.xls that when I moved the
workbook the Macro was in the Macro would change with the formulas. Any help
would be appreciated, Thanks.
Dim bkList As New Collection
With Workbooks("1DLSUNDAY.XLS").Worksheets("Master")
Set rng = .Range(.Cells(2, 3), .Cells(200, 3).End(xlDown))
End With

On Error Resume Next
For Each cell In rng
if len(trim(cell)) 0 AND val(trim(cell)) <9521 AND val(trim(cell)) 0
Then
bkList.Add Trim(cell.Text), Trim(cell.Text)
end if
Next
On Error GoTo 0

For Each itm In bkList
Workbooks.Open "C:\Documents and Settings\Tom\Desktop\CHARTER BLANK\NEW
BLANK\" & _
itm & ".xls"
Next

 
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
Macro File Locations Lori-Wheaten Excel Discussion (Misc queries) 2 June 9th 08 05:56 PM
How do you change the File save locations in Excel 2007? pglufkin Excel Discussion (Misc queries) 2 December 18th 06 07:22 PM
File locations becoming relative when workbook is emailed by macro Sam Excel Discussion (Misc queries) 1 September 4th 06 07:18 PM
toolsoptions cannot change file locations ab Excel Discussion (Misc queries) 6 December 10th 05 03:02 PM
request macro to save file to multiple, separate locations Joseph Spain Excel Programming 3 April 26th 05 02:05 PM


All times are GMT +1. The time now is 06:37 AM.

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"