Display sheet upon exit

J

JAMES SYLVESTERSR

Is there a way in VBA to cause a worksheet to display when exiting the
workbook.
 
M

merjet

Is there a way in VBA to cause a worksheet to display
when exiting the workbook.

Yes, put code like this in the ThisWorkbook module.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Sheets("fill_name").Activate
End Sub


HTH,
Merjet
 
B

Bob Phillips

James,

It could be done with the Workbook_Deactivate event , but ..
Wouldn't this mean that you could never switch to another workbook, as by
making a worksheet in that workbook visible, you re-enter it?

--

HTH

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top