Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You cannot initialize a static variable in VB per se, but ...
Sub Counter() Static counter as Integer If counter < 12 Then counter = 12 Else counter = counter + 1 End If Debug.print x End Sub BTW, a Long has a larger range than an Integer, if it matters. "Adrian" wrote in message ... Hi, I am writing a static procedure as follows: Sub Test call Counter call Counter call Counter End Sub Counter() Static counter as Integer counter = counter + 1 Debug.print x End Sub I want to print a series of numbers 12,13,14, from the test procedure instead of 1,2,3 . How do i go about doing it ? In other words, how do i initialize a static variable in a Sub procedure ? Thanks. -- Regards, Adrian |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
XL 07 Initializing Folders | Excel Discussion (Misc queries) | |||
Static Variables | Excel Programming | |||
Static variables | Excel Programming | |||
Static variables | Excel Programming | |||
Initializing User Forms | Excel Programming |