• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Close and rename

KreshBell

New Member
I have a macro that is fine with me. Saves the existing file as a new one and renames it.
Code:
Sub rename()
    F$ = ActiveWorkbook.Path & ActiveWorkbook.Sheets(1).["\"&AB2&"_"&U2&"_"&AA2&"_"] & ActiveSheet.Name & ".xlsx"
    Application.DisplayAlerts = False
    ActiveWorkbook.SaveAs F, 51
    Application.DisplayAlerts = True
End Sub

I wonder if it is possible to create a macro that will close and rename the existing file in the same way?
 
The message is obvious : it can't work with the same arguments so maybe​
just looking at the SaveCopyAs VBA help in order you can see how it works …​
 
Back
Top