Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mac Mac is offline
external usenet poster
 
Posts: 213
Default Static global varibale - where tu put it?

Hello,
I need to initialize a couple of objects on a sheet just once upon
Sheet.Activate event; I'd use a bool varibale as a semaphor so that further
inits would be prevented if a user returned to that sheet from another one
and this semaphor would have been set to true. Now - where should I put this
variable for it to retain its value throughout the 'lifetime' of the whole
workbook?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Static global varibale - where tu put it?

--These variables are to be dimensioned at the top of a module like
Public blnSheet1 as Boolean

--For a clear picture on this refer the below link
http://www.ozgrid.com/VBA/variable-scope-lifetime.htm


--
Jacob


"Mac" wrote:

Hello,
I need to initialize a couple of objects on a sheet just once upon
Sheet.Activate event; I'd use a bool varibale as a semaphor so that further
inits would be prevented if a user returned to that sheet from another one
and this semaphor would have been set to true. Now - where should I put this
variable for it to retain its value throughout the 'lifetime' of the whole
workbook?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Static global varibale - where tu put it?


Use a Dim statement in a module or Class module out side any sub or
function


Dim A
sub Test
A = 5
end test


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=161663

Microsoft Office Help

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Static variable VBA beginner Excel Programming 4 September 16th 08 10:22 AM
"Static" Behavior without Static Defn Steve Drenker[_2_] Excel Programming 1 March 2nd 06 01:33 AM
Static Header Row Andrew Chalk Excel Discussion (Misc queries) 7 January 4th 06 03:11 AM
Static Row DY New Users to Excel 5 September 9th 05 12:36 AM


All times are GMT +1. The time now is 03:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"