Run auto macro on workbook close

  • Thread starter Thread starter sgrech
  • Start date Start date
S

sgrech

Hi,
I am sure this is a simple problem for the experts out there.

I have a workbook with x number of worksheets. All of the sheets hav
data. One of the sheets is called summary. When the user has update
anyone of the sheets (other than the summary sheet) and then saves an
closed the workbook, I need the summary worksheet to be activate
before this process is completed. Therefore when the file is nex
opened The worksheet call summary will be always be on view.

Please help.

Thanks
Simon :confused
 
Hi Simon

or another approach is to put a macro in on open of the workbook that
activates the summary sheet
e.g.
Right mouse click on any of the worksheet tabs
choose view / code
on the left of the screen you should see the name of your workbook in
brackets & bold (if not, choose view / project explorer from the menu)
under your workbook name you should see ThisWorkbook (after the list of
sheets)
double click on ThisWorkbook
on the right you should have a blank area - with two drop down boxes, choose
the left hand side one and from it choose Workbook
the right hand side one should change to Open
and you should see
Private Sub Workbook_Open()

End Sub

between these two lines type

Sheets("Summary").activate

switch back to your workbook (Alt & F11) and close & save the workbook.

test it out

Cheers
JulieD
 
Back
Top