reverting to first page on exit

  • Thread starter Thread starter mhillis
  • Start date Start date
M

mhillis

Is there a way of making an excel file revert to the first page each
time the file is closed. If possible is it something that can be put in
this thread (text) so I can copy and past it into note pad and then be
able to use it? I am unable to download off the internet on this
computer.
Yhanks in advance for any help anyone can give.
 
Best to do it workbook open

Private Sub Workbook_Open()
Worksheets(1).Activate
End Sub

put this in the ThisWorkbook code module.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
You can use this event for this

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Sheets(1).Select
End Sub

Right click on the Excel icon next to File in the menubar
And choose View code

You are now in the Thisworkbook module
Paste the Event in this place
Alt-Q to go back to Excel
Save the file
 
now is there anyway to get the first page to be the page opened when the
file is opened, now matter what page the file was saved on?
 
Hi
now is there anyway to get the first page to be the page opened when the
file is opened, now matter what page the file was saved on?


If you save the file one time with Sheet1 active then
this event is doing this if you not use the save button.
If you close the file with the X or File>Close this is working

But you can use this to select sheet1 when you open the workbook

Private Sub Workbook_Open()
Sheets(1).Select
End Sub
 
I've already given you that!

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top