![]() |
= How to setup vars when a workbookopen event is launched?
I need to setup some variables in my VBA code before the program starts. I
think one could to include this setup in the Workbook_Open event, before the worksheet be loaded. How Can I do this? Second: does VBA support "Typed Constants" like Delphi or C? For example I would like to initialize a global (public) boolean var called FirstTime as True, so when the first macro code starts running it has this True value by default. |
= How to setup vars when a workbookopen event is launched?
Create this variable in a standard code module
Public FirstTime As Boolean In the Thisworkbook class modujle add Private Sub Workbook_Open() FirstTime = True End Sub -- HTH RP "hcova" wrote in message ... I need to setup some variables in my VBA code before the program starts. I think one could to include this setup in the Workbook_Open event, before the worksheet be loaded. How Can I do this? Second: does VBA support "Typed Constants" like Delphi or C? For example I would like to initialize a global (public) boolean var called FirstTime as True, so when the first macro code starts running it has this True value by default. |
All times are GMT +1. The time now is 05:38 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com