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: 68
Default Save with filename ACJRNyyyymmddhhmm

Good morning

I am currently using the following code to save a worksheet as a custom .CSV
filetype:

intFile = FreeFile
Open "c:\test.txt" For Output As #intFile
For Each rngRow In ActiveSheet.UsedRange.Rows
strData = ""
For Each cell In rngRow.Cells
strData = strData & Trim(cell)
Next
Print #intFile, strData
Next
Close #intFile

As you can see, it saves the file as "test.txt". However, as I will need to
run this macro daily, I need to be able to save the file with the following
filename:
"ACJRNyyyymmddhhmm.txt" eg: today would be (assuming I ran the macro at the
time I wrote this query)
"ACJRN200909231006.txt"

Could someone please suggest a method that would achieve this desired
filename each day? Please note, it is critical that I keep the formatting,
within the file, that has been achieved by the above code.
 
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
Cell("filename") doesn't update to new filename when do save as. Louis Excel Worksheet Functions 2 March 22nd 07 07:27 PM
VBA - Save with New Filename Louise Excel Programming 2 October 13th 06 01:59 PM
VBA - Save with new filename Louise Excel Programming 1 October 13th 06 01:50 PM
save as different filename Tom Excel Programming 3 May 4th 05 03:41 AM
Save Filename Peter Excel Programming 3 February 4th 05 01:15 PM


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