Personally, I would use a Private Module level variable in the Form's module. I don't know if that would make a difference in your situation, but it would prevent any other code from accessing the variable. I would also prefix the variable name with an "f"
Private fVarName as whatever
If the problem persists, I would try converting it to a Property
Private fVarName As Whatever
Private Property Get PropertyName() As Whatever
PropertyName = fVarName
End Property
Private Property Let PropertyName(InputValue As Whatever)
fVarName = InputValue
End Property
Note that if the Variable is an Object type, You need to use a Property Set sub. If you declare the Property Subs Public, any code in any module can access them
How to use in UserForm event codes
Sub CommandButton1_Click()
Me.PropertName = "SeventySeven Bottles Of Beer"
End Sub
Sub CommandButton2_Click()
With Me
.Label1.Caption = .PropertyName
.PropertyName = ""
End With
End Sub
If you declare the Properties Public, then in another module, (While the Form is NOT unloaded,)
Sub T()
Dim MyVar As STring
MyVar = UserForm1.PropertyName
UserForm1.PropertyName = "A Partridge in a Pear tree"
End Sub