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: 10
Default Looping Open and Save as CSV

I have to open worksheets and then save them as CSV files for another
program. When I used the macro recorder, it copied the entire path so that
when I run macro is puts the file back in the same folder every time
regardless of path for the XLS file. All the file names are VOLUME, but the
path changes for the various options. How do I edit the macro below to get
it to save XLS files as CSV files in the same directory that the XLS file
cam from instead of the one where I initially recorded the macro?

Active..SaveAs Filename:= _
"Y:\Yarger Engineering\20090802\Synchro\Phase 1
(2011)\Sunday\AM\VOLUME.csv" _
, FileFormat:=xlCSV, CreateBackup:=False

If it makes any difference, I do this all the time, but the path structure
changes from project to project. I would like to automatically open,
update, save and then save as CSV file, but I have no idea how to set up a
macro to loop within an unknown path for future projects. The first part of
the path will always be "Y:\Yarger Engineering\" followed by the project
number and name, then "synchro", phase or year, maybe the day of week but
normally not since we normally don't worry about weekends, and then the time
of day. I may have an upcoming project where I will have to do this 200
times, so I really don't want to have to do this manually any more. In some
cases, this will be creating the first CSV file and in others it will
overwrite an existing CSV file.

Brad

Excel 2002 on XP Pro SP 3


 
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
workbook open in looping Patrick Molloy Excel Programming 1 July 27th 09 11:13 AM
Looping through list of workbooks to open & sheets to move Beverly Excel Programming 4 March 4th 08 08:16 PM
Looping thru open word documents to find a specific one dsimcox Excel Programming 1 August 8th 07 04:58 PM
Looping folder changing - Save Preview Picture Piranha[_50_] Excel Programming 2 October 2nd 05 12:33 PM
VBA code for looping through open workbooks and worksheets Jamie Martin[_2_] Excel Programming 1 July 24th 03 06:44 PM


All times are GMT +1. The time now is 07:17 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"