Save and Close Workbook

bmonique368

New Member
Joined
Oct 23, 2014
Messages
17
Hello Everyone.

I hope someone will be able to assist me with this issue.

Each time I open my Ms Excel Workbook it shows the sheet it was on before it was closed. What I want to do is, on the click of a button, it will do three things: 1. save the file. 2. Return to a main page 3. Close the file.

Currently it does two of the three with the following code;
Code:
ActiveWorkbook.Close SaveChanges:=True

Is there a way to add the third task to the above code?

Your help will be highly appreciated.

Thank You!....
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Code:
With Activeworkbook
.sheets("main page 3").select  'Put the correct name of the sheet between the quote marks
.close savechanges:= True
End With
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,192
Members
449,072
Latest member
DW Draft

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