N
Neall
I am hoping someone can help me here, I have this syntax that works great
except for 2 things, I just want to save the worksheet named proposal and if
the user does not wish to over write the existing file and they click no for
the process to stop and not give a debug error.
here is what I have
Private Sub CommandButton1_Click()
'
' prepprop03 Macro
' Macro recorded 6/2/2009 by Neall
'
'
Rows("3:4").Select
Selection.EntireRow.Hidden = True
Range("C16:C17").Select
Selection.Interior.ColorIndex = 2
Dim originalPrinter
If MsgBox("Did you need to change the Industry?" & vbCrLf & vbCrLf & _
"Click No to continue to Step 2", vbYesNo) <> vbNo Then Exit Sub
If MsgBox("Did you need to change the Pricing Level?" & vbCrLf & vbCrLf & _
"Click No to continue with Step 3", vbYesNo) <> vbNo Then Exit Sub
If MsgBox("Are there any further changes you wish to make?" & vbCrLf &
vbCrLf & _
"Click No to continue saving quote to C:\TEMP", vbYesNo) <> vbNo Then Exit Sub
Dim CSName As String
Dim OldPath As String
Dim OldFName As String
'This is the cell containing the name for the new book.
CSName = Worksheets("NEW_RENEWAL_CALC").Range("B3").Value
folder = Environ("Temp")
'This is the code to get path & Name data, not used.
'OldPath = ActiveWorkbook.Path
'MsgBox OldPath
'OldFName = ActiveWorkbook.Name
'MsgBox OldFName
'ActiveWorkbook.Sheets.Select
'Make a copy of the original workbook.
Sheets.Copy
ActiveSheet.Activate
'Save the new workbook.
ActiveWorkbook.SaveAs (CSName)
'Close the new saved workbook.
ActiveWorkbook.Close
'Close the original workbook, do not save.
'ActiveWorkbook.Close (False)
End Sub
Any help would be greatly appreciated
except for 2 things, I just want to save the worksheet named proposal and if
the user does not wish to over write the existing file and they click no for
the process to stop and not give a debug error.
here is what I have
Private Sub CommandButton1_Click()
'
' prepprop03 Macro
' Macro recorded 6/2/2009 by Neall
'
'
Rows("3:4").Select
Selection.EntireRow.Hidden = True
Range("C16:C17").Select
Selection.Interior.ColorIndex = 2
Dim originalPrinter
If MsgBox("Did you need to change the Industry?" & vbCrLf & vbCrLf & _
"Click No to continue to Step 2", vbYesNo) <> vbNo Then Exit Sub
If MsgBox("Did you need to change the Pricing Level?" & vbCrLf & vbCrLf & _
"Click No to continue with Step 3", vbYesNo) <> vbNo Then Exit Sub
If MsgBox("Are there any further changes you wish to make?" & vbCrLf &
vbCrLf & _
"Click No to continue saving quote to C:\TEMP", vbYesNo) <> vbNo Then Exit Sub
Dim CSName As String
Dim OldPath As String
Dim OldFName As String
'This is the cell containing the name for the new book.
CSName = Worksheets("NEW_RENEWAL_CALC").Range("B3").Value
folder = Environ("Temp")
'This is the code to get path & Name data, not used.
'OldPath = ActiveWorkbook.Path
'MsgBox OldPath
'OldFName = ActiveWorkbook.Name
'MsgBox OldFName
'ActiveWorkbook.Sheets.Select
'Make a copy of the original workbook.
Sheets.Copy
ActiveSheet.Activate
'Save the new workbook.
ActiveWorkbook.SaveAs (CSName)
'Close the new saved workbook.
ActiveWorkbook.Close
'Close the original workbook, do not save.
'ActiveWorkbook.Close (False)
End Sub
Any help would be greatly appreciated