View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
TomPl TomPl is offline
external usenet poster
 
Posts: 342
Default Public Variables

A brief summary, I hope it is not too cryptic:

€˘ Variable scope:
o Procedural level variable (declared within the procedure and available
only within the procedure).
o Module level variable (declared at the top of the module)
ď‚§Dim VariableName as Type (Available only within the module).
ď‚§Private VariableName as Type (Available only within the module).
ď‚§Public VariableName as Type (Available throughout the project).
€˘ Variable lifetime:
o By default variables retain their assigned value only until the
subroutine in which they are declared executes the exit or end statement.
o If the subroutine or the variable is declared as static the variable
retains its value until the workbook is closed.
o Module level variables are static.

Tom