D
donbowyer
I declare a Variable as Public (to preserve its value throughout code
execution) eg:-
Public MyText As Variant (this is done in a Standard Module)
Then in a UserForm I have:-
"Private Sub CommandButton1_Click()
MyText = TextBox1
(The Locals Window correctly shows MyText has whatever I put in TextBox1)
Do some other things
Unload UserForm3
End Sub"
When the UserForm is unloaded and execution returns to a Standard module I
need to use the value in MyText - but in the Locals Window I see that
MyText=0.
I expected the value in MyText to be retained even though the UserForm where
it was created has been unloaded.
What am I doing wrong?
execution) eg:-
Public MyText As Variant (this is done in a Standard Module)
Then in a UserForm I have:-
"Private Sub CommandButton1_Click()
MyText = TextBox1
(The Locals Window correctly shows MyText has whatever I put in TextBox1)
Do some other things
Unload UserForm3
End Sub"
When the UserForm is unloaded and execution returns to a Standard module I
need to use the value in MyText - but in the Locals Window I see that
MyText=0.
I expected the value in MyText to be retained even though the UserForm where
it was created has been unloaded.
What am I doing wrong?