Macro to append number to file name

G

Guitarzann

Greetings,

I am trying to find the VB code to create a process where the workbook can
be saved on the same folder without overwriting the existing workbook.
Multiple people will be dropping their copies of the workbook onto the same
folder.

The goal is to have the folder contain files to look like:
Master (1),
Master (2),
Master (3), etc.

Thanks for your help!
Rick
 
D

Don Guillett

Sub saveworkbookas()
dim i as long
dim fname as string
For i = 1 To 3
fname = "Master" & i & ".xls"
MsgBox fname
ActiveWorkbook.SaveAs Filename:=fname
Next i
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top