Saveas Exit & Close Without Prompts

VinceF

Board Regular
Joined
Sep 22, 2007
Messages
172
Office Version
  1. 2016
Platform
  1. 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
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Anthony...The screenshot that you posted is exactly the same as I'm getting.
Is there a line or two that can be added to also close that down?
 
Upvote 0
If you need to close Excel, then remove the line ActiveWorkbook.Close False and insert (just before End Sub):
VBA Code:
Application.Quit
 
Upvote 0
Solution
Anthony..
I'm happy I'm to report that it's working excellent...
I totally appreciate your time and effort to resolve this...
Thank You
I'll be sure to mark this as solved...!!!!

VinceF
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,959
Members
449,096
Latest member
Anshu121

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top