Thread: Static Variable
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
WLMPilot WLMPilot is offline
external usenet poster
 
Posts: 470
Default Static Variable

I am using a userform. When "ENTER" commandbutton is clicked, it runs a
macro. In this macro I have a static variable, counter, that increments by
one each time through. When I added a command in the macro to call a
subroutine, the counter no longer maintains the correct value. When I use
msgbox to check the value, it is blank.

Up until the point prior to adding the call for the subroutine, the counter
worked fine.

What happened and what can I do to fix it?

Thanks,
Les