Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automatically resest variable values = 0 after runtime
I have about 40 variables at the top of a Userforms Declaration section. I
do this because I need the variables calculated in one procedure and made available to another procedure when they are all done being calulated. The problem is I currently have to write code to reset all the variables back to 0 before they are recalculated. If there a way to declare the variable (DataType Single) = 0 at the beginning of runtime. For example: Option Explicit Dim var1 As Single = 0 Dim var2 As Single = 0 Private Sub CalculateVariables() ' code to calculate var1 & var2 End Sub Private Sub UseVariables ' code to use var1 & var2 End Sub After runtime var1 & var2 are reset to 0 -- Cheers, Ryan |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Runtime Error '91' Object variable or With block variable not set | Excel Discussion (Misc queries) | |||
Runtime Error 91 Object variable or With block variable not set. | Excel Programming | |||
Excel2003 - Automatically sum a variable number of rows | Excel Worksheet Functions | |||
VBA automatically updating variable names | Excel Programming | |||
Runtime error 91: Objust variable or with block.... | Excel Programming |