N
nuver
Hello
With a macro I need to close my file and save the file as the sheet
name in the current directory. I can accomplish this with the code
below, but if the file exists and the user selects no to the replace
existing file prompt then, I need to prompt the user to enter a new
name to save the file as under the same directory. Once the new name is
entered I need the macro to continue.
Any help is greatly appreciated.
Dim sPath As String
Dim sh As Worksheet
sPath = ActiveWorkbook.Path
For Each sh In ActiveWorkbook.Worksheets
sh.Copy
ActiveWorkbook.SaveAs sPath & "\" & "Master " & sh.Name & _
".xls", xlNormal
Next
With a macro I need to close my file and save the file as the sheet
name in the current directory. I can accomplish this with the code
below, but if the file exists and the user selects no to the replace
existing file prompt then, I need to prompt the user to enter a new
name to save the file as under the same directory. Once the new name is
entered I need the macro to continue.
Any help is greatly appreciated.
Dim sPath As String
Dim sh As Worksheet
sPath = ActiveWorkbook.Path
For Each sh In ActiveWorkbook.Worksheets
sh.Copy
ActiveWorkbook.SaveAs sPath & "\" & "Master " & sh.Name & _
".xls", xlNormal
Next