Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003

    Unanswered: use a static variable

    I wouldl like to use a static variable and set it to let my code know that the code has already executed.

    How can i do that?

  2. #2
    Join Date
    Oct 2003
    Without knowing a little more about what you want to do, do you want a Static variable or a Constant? Will the value change as the procedure executes?

    If Static, then declare it at the beginning of the procedure after the Sub line (Static variables are only declared at the procedure level).

    Sub Sample()
    Static Counter As Integer
    [more code]
    End Sub
    old, slow, and confused
    but at least I'm inconsistent!

    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts