Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 -- nuver ------------------------------------------------------------------------ nuver's Profile: http://www.excelforum.com/member.php...o&userid=10036 View this thread: http://www.excelforum.com/showthread...hreadid=482918 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
cancel save | Excel Discussion (Misc queries) | |||
Save - Yes / No / Cancel | Excel Discussion (Misc queries) | |||
Capturing Cancel button on save file dialogue | Excel Programming | |||
How to CANCEL file SAVE PROMPT when MACRO is running? | Excel Discussion (Misc queries) | |||
Cancel Macro is user selects 'cancel' at save menu | Excel Programming |