ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Increment File Name by 1 (https://www.excelbanter.com/excel-programming/324089-increment-file-name-1-a.html)

Blue

Increment File Name by 1
 
I have 52 files, one for each week of the year, and one blank master. When
a change is required the master is updated then the files are over written
for the weeks to come, this is done manually one file at a time. The file
names are
RC1 WK1
RC1 WK2
etc
Is it possible to save the blank master as RC1 WK? to RC1 WK52, ? being the
first file to start from, over writing the previous files?

Thanks Blue



Kaisies - ExcelForums.com

Increment File Name by 1
 
doing from memory, so syntax might not be perfect but...

Private CommandButton1_Click (

dim
dim pathofsavefile as strin
pathofsavefile = "C:\temp\RC1 WK

x = 1

application.displayalerts = fals
Do Until x 5
ActiveWorkbook.SaveAs Filename:=pathofsavefile &
x = x +
Loo
Application.DisplayAlerts = Tru

End Su


Kaisies - ExcelForums.com

Increment File Name by 1
 
doing from memory, so syntax might not be perfect but...

Private CommandButton1_Click (

dim
dim pathofsavefile as strin
pathofsavefile = "C:\temp\RC1 WK

x = 1

application.displayalerts = fals
Do Until x 5
ActiveWorkbook.SaveAs Filename:=pathofsavefile &
x = x +
Loo
Application.DisplayAlerts = Tru

End Su


Soltisolti

Increment File Name by 1
 

:rolleyes: A bit late but thanks for the info

blue


--
Soltisolti
------------------------------------------------------------------------
Soltisolti's Profile: http://www.excelforum.com/member.php...o&userid=15118
View this thread: http://www.excelforum.com/showthread...hreadid=349182



All times are GMT +1. The time now is 08:54 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com