ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   VBA Code to kick off macro when workbook command to close is initi (https://www.excelbanter.com/excel-discussion-misc-queries/95728-vba-code-kick-off-macro-when-workbook-command-close-initi.html)

zulfer7

VBA Code to kick off macro when workbook command to close is initi
 
I wanted some code to run whenever someone was to close the worksheet. Any
Ideas?

Loomah

VBA Code to kick off macro when workbook command to close is initi
 
Hi
Put your code in the Workbook_BeforeClose event proceedure.

Open the VBE (ALT+F11)
Double click ThisWorkbook in the project explorer window on the left hand
pane
from the left hand dropdown in the code pane (on the right of the window)
choose workbook
Select BeforeClose from the dropdown to the left

;-)



"zulfer7" wrote in message
...
I wanted some code to run whenever someone was to close the worksheet. Any
Ideas?




zulfer7

VBA Code to kick off macro when workbook command to close is i
 
This was PERFECT!!! Thanks!!!

"Loomah" wrote:

Hi
Put your code in the Workbook_BeforeClose event proceedure.

Open the VBE (ALT+F11)
Double click ThisWorkbook in the project explorer window on the left hand
pane
from the left hand dropdown in the code pane (on the right of the window)
choose workbook
Select BeforeClose from the dropdown to the left

;-)



"zulfer7" wrote in message
...
I wanted some code to run whenever someone was to close the worksheet. Any
Ideas?






All times are GMT +1. The time now is 09:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com