Save Spreadsheet on Closing

Help improve Bet Angel.
spreadbetting
Posts: 3140
Joined: Sun Jan 31, 2010 8:06 pm

No problem, glad it works for you. There's also a similar Workbook_Open code you can use that fires off code once a worksheet has been opened. I use it to set up certain variables and ensure any trigger cells are clear when a workbook opens. Might be of use somewhere down the line to you. Again it just goes in the ThisWorkbook module.

Code: Select all

Private Sub Workbook_Open()

'any code in here

End Sub
sa7med
Posts: 800
Joined: Thu May 18, 2017 8:01 am

spreadbetting wrote:
Wed Nov 20, 2019 2:01 pm
No problem, glad it works for you. There's also a similar Workbook_Open code you can use that fires off code once a worksheet has been opened. I use it to set up certain variables and ensure any trigger cells are clear when a workbook opens. Might be of use somewhere down the line to you. Again it just goes in the ThisWorkbook module.

Code: Select all

Private Sub Workbook_Open()

'any code in here

End Sub
Nice one SB, had no idea there was a 'before close' event. Cheers!
Post Reply

Return to “Suggestions”