Format workspace on file opening and restore it on closing

phil_r

New Member
Joined
Oct 16, 2002
Messages
19
Hi,
I'd like to create a macro that formats the workspace to make it as clean as possible when the file is opened. Then, I'd like to restore the initial workspace when the user closes the file.
How can I create a macro that lounches on file opening?
And another one that lounches when the file is closed?
Or is there another way to obtain that?
Thanks in advance for your help;
Regards
Phil
This message was edited by phil_r on 2002-11-15 07:13
 

Some videos you may like

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

DonkeyOte

MrExcel MVP
Joined
Sep 6, 2002
Messages
9,123
Phil

Naming your Macro AUTO_OPEN will mean it runs when you start the file

Naming another Macro AUTO_CLOSE means it will run when the file is closed.
 

DonkeyOte

MrExcel MVP
Joined
Sep 6, 2002
Messages
9,123
Sorry Phil forgot the other bit

Name your views - say mine is LUKE

Sub AUTO_OPEN

ActiveWorkbook.CustomViews("LUKE").Show

End Sub


Sub AUTO_CLOSE

ActiveWindow.Zoom = 100

End Sub

Luke
 

phil_r

New Member
Joined
Oct 16, 2002
Messages
19
THANKS!!!
That's exactly what I wanted to know.
You've made a happy man.
Ciao and good week end
Phil
 

Watch MrExcel Video

Forum statistics

Threads
1,123,531
Messages
5,602,202
Members
414,513
Latest member
junbuggle

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
Top