Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You seem to be asking for code like this...
OldFN = "G:\My Reports\Transfers\stafflist.txt" NewFN = Replace(OldFN, "Transfers", Format(Date, _ "mmmm yy"), Compa=vbTextCompare) NewFN = Replace(NewFN, ".txt", " " & Format(Date, "ddmmyy") & ".txt") Name OldFN As NewFN where I have assumed your own code has retrieved the filename and path... just assign it to the OldFN variable and use the rest of the code I posted to change it to the format you want and to save it to the new location. -- Rick (MVP - Excel) "Tracey" wrote in message ... Hi All, I would like to rename and save a .txt file from within an Excel macro. I don't need to open the file just Save As to another location. Currently: G:\My Reports\Transfers\stafflist.txt Needs to be: G:\My Reports\December 09\stafflist 041209.txt Is there some code that will do this for me - thanks in advance :) -- Tracey @ BrisVegas |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Rename Worksheet Tab as File Name Using a Macro | Excel Discussion (Misc queries) | |||
rename excel file name | Excel Discussion (Misc queries) | |||
Batch file rename macro | Excel Programming | |||
Rename .txt file with macro | Excel Programming | |||
rename file macro | Excel Programming |