Without changing the current open file name,
Save a copy of the file as specified in title.
The version number V should be attached to the end of the file.
If the name exists, the version number should be incremented by one.
Example:
Active workbook = C:\test\book.xls
Save copy as : C:\test\bookphrase1.xls
If C:\test\bookphrase1.xls exists, proceed to C:\test\bookphrase2.xls etc.
I am a NOVICE on vba, so please do not laugh, at least I tried:
Sub test()
Dim saf As String
Dim phr As String
Dim v As Variant
'
phr = "phrase" 'no blanks
saf = ThisWorkbook.FullName
v = 1
'
Do
If saf + phr + v = "" Then
ActiveWorkbook.Save 'optional
ActiveWorkbook.SaveCopyAs saf + phr + v
Else
v = v + 1
Exit Do
End If
Loop
End Sub
Bookmarks