Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Cell("filename") doesn't update to new filename when do save as. | Excel Worksheet Functions | |||
VBA - Save with New Filename | Excel Programming | |||
VBA - Save with new filename | Excel Programming | |||
save as different filename | Excel Programming | |||
Save Filename | Excel Programming |