Before close request

Pauljj

Well-known Member
Joined
Mar 28, 2004
Messages
2,046
I have a sheet called Promotions, when a user closes the workbook, I need to make sure the Promotions sheets is hidden, so when it is re-opened the user cannot see it, could someone help me on this please

Cheers
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Hi: Actually, you probably mean Before Save

Use the ThisWorkbook Before Save Event and include this line
Code:
WorkSheets("Promotions").Visible = xlSheetHidden

lenze
 
Upvote 0
Actually, I spoke too quickly. You will probably want to use the Before_Close event like this.
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Worksheets("Promotions").Visible = xlSheetHidden
    Me.Save
End Sub

This will allow you to save the book without closing and not hiding the sheet.

lenze
 
Upvote 0

Forum statistics

Threads
1,213,557
Messages
6,114,287
Members
448,562
Latest member
Flashbond

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