R
RyanH
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
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