VinceF
Board Regular
- Joined
- Sep 22, 2007
- Messages
- 189
- Office Version
- 2016
- Platform
- Windows
Good Morning Experts,
I'm having difficulty to get the workbook to saveas, exit and close without the prompts, I've tried several codes off the internet all to no avail.
I'd like for it to do the following...
Name the workbook to : Indianwood Quota.xlsm - saved in C:\Golf\Indianwood Quota - and close the workbook without any prompts
I'd like to add this to the code below.
Much appreciate your help.
VinceF
Excel 2016
Private Sub RESET_Click()
Dim warning
warning = MsgBox(Range("A1").Value & " 1. LOCK EARNINGS 2. ADJUST QUOTA'S 3. SAVE ROUND 4.RESET SHEET. This will reset the entire sheet. Select OK to continue or select CANCEL to continue without resetting", vbOKCancel, "WARNING STOP COMPLETE THESE 4 ITEMS BEFORE PROCEEDING")
If warning = vbCancel Then Exit Sub
On Error Resume Next
Sheets("main").Range("B11:H50").SpecialCells(xlCellTypeConstants).ClearContents
Sheets("main").Range("C5:C8").SpecialCells(xlCellTypeConstants).ClearContents
Sheets("main").Range("O11:W50").SpecialCells(xlCellTypeConstants).ClearContents
Sheets("main").Range("Y11:AG50").SpecialCells(xlCellTypeConstants).ClearContents
Sheets("main").Range("dD11:D50").SpecialCells(xlCellTypeConstants).ClearContents
Sheets("main").Range("D3:L3").SpecialCells(xlCellTypeConstants).ClearContents
Sheets("main").Range("g11:H50").SpecialCells(xlCellTypeConstants).ClearContents
Sheets("main").Range("L7").ClearContents
Sheets("main").Range("AK2:AL2").ClearContents
Sheets("main").Range("N3:O3").ClearContents
Sheets("main").Range("B2").Value = "SELECT COURSE"
Sheets("main").Range("B3").Value = "STR ADJ"
Sheets("main").Range("C3").Value = "SELECT GAME"
Sheets("main").Range("L5").Value = "STAFF"
MsgBox "THE FORM HAS BEEN RESET."
ActiveWorkbook.SaveAs ("C:\Golf\indianwood Quota\" & ThisWorkbook.Sheets("Main").Range("C1").Value & ".xlsm")
End Sub
I'm having difficulty to get the workbook to saveas, exit and close without the prompts, I've tried several codes off the internet all to no avail.
I'd like for it to do the following...
Name the workbook to : Indianwood Quota.xlsm - saved in C:\Golf\Indianwood Quota - and close the workbook without any prompts
I'd like to add this to the code below.
Much appreciate your help.
VinceF
Excel 2016
Private Sub RESET_Click()
Dim warning
warning = MsgBox(Range("A1").Value & " 1. LOCK EARNINGS 2. ADJUST QUOTA'S 3. SAVE ROUND 4.RESET SHEET. This will reset the entire sheet. Select OK to continue or select CANCEL to continue without resetting", vbOKCancel, "WARNING STOP COMPLETE THESE 4 ITEMS BEFORE PROCEEDING")
If warning = vbCancel Then Exit Sub
On Error Resume Next
Sheets("main").Range("B11:H50").SpecialCells(xlCellTypeConstants).ClearContents
Sheets("main").Range("C5:C8").SpecialCells(xlCellTypeConstants).ClearContents
Sheets("main").Range("O11:W50").SpecialCells(xlCellTypeConstants).ClearContents
Sheets("main").Range("Y11:AG50").SpecialCells(xlCellTypeConstants).ClearContents
Sheets("main").Range("dD11:D50").SpecialCells(xlCellTypeConstants).ClearContents
Sheets("main").Range("D3:L3").SpecialCells(xlCellTypeConstants).ClearContents
Sheets("main").Range("g11:H50").SpecialCells(xlCellTypeConstants).ClearContents
Sheets("main").Range("L7").ClearContents
Sheets("main").Range("AK2:AL2").ClearContents
Sheets("main").Range("N3:O3").ClearContents
Sheets("main").Range("B2").Value = "SELECT COURSE"
Sheets("main").Range("B3").Value = "STR ADJ"
Sheets("main").Range("C3").Value = "SELECT GAME"
Sheets("main").Range("L5").Value = "STAFF"
MsgBox "THE FORM HAS BEEN RESET."
ActiveWorkbook.SaveAs ("C:\Golf\indianwood Quota\" & ThisWorkbook.Sheets("Main").Range("C1").Value & ".xlsm")
End Sub