Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, excellent.
"Leith Ross" wrote: Hello Byron, I made the needed changes to David Lloyd's code for you. Here it is for 2000. Code: -------------------- Function SaveWorksheets() Dim sPath As String Dim sFileName As String Dim sh As Worksheet Dim iResult As VbMsgBoxResult Dim fd sPath = ActiveWorkbook.Path For Each sh In ActiveWorkbook.Worksheets sFileName = sPath & "\" & "Master " & sh.Name & ".xls" sh.Copy If Dir(sFileName) < "" Then iResult = MsgBox("The default file " & sFileName & " already exists in " & _ "directory " & sPath & ". Do you want to replace it?", vbQuestion + vbYesNoCancel, "Save File") If iResult = vbYes Then Application.DisplayAlerts = False ActiveWorkbook.SaveAs sFileName, xlNormal Application.DisplayAlerts = True ElseIf iResult = vbNo Then fd = Application.GetSavesAsDialog InitialFileName:= sPath If fd < "" Then ActiveWorkbook.SaveAs sFileName, xlNormal End If Else End If Next End Function -------------------- Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 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 |