Re: global dim & set

From: Amedee Van Gasse (nzrqrr.ina.tnffr_at_rztebhc.or)
Date: 07/27/04


Date: Tue, 27 Jul 2004 07:08:36 -0700

mcalex wrote:

> Hi all
> I'm a bit new to vb, and want to know if there is a way of declaring
> and setting a global variable outside of any procedures. I have a
> public boolean (debugOn) that runs my debug.print statements if true
> and doesn't clutter the immediate window if false. Everything's fine
> as long as I set it within procedures, but I cannot convince VBA to
> set it outside of a procedure, ie at declaration time. Is this
> possible? and if so, how?
>
> Many thanks
> Alex

Scope of variables:
Application: declare with Public
Module: declare with Private
Procedure: declare with Dim

Read this also:
Using Variables (Properly) In VBA
http://www.cpearson.com/excel/variables.htm

-- 
To top-post is human, to bottom-post and snip is sublime.


Relevant Pages

  • RE: Error
    ... PreFilterMessage method takes parameter by reference. ... Declare this method in the following way. ... public boolean PreFilterMessage ... I have implemented IMessageFilter interface in a class TestMessageFilter. ...
    (microsoft.public.dotnet.vjsharp)
  • Re: java ,program
    ... > Declare a method to determine whether an integer is a prime number. ... public static void main(Stringargs) ... public boolean isPrime ...
    (comp.lang.java.help)