Folks,
I have a userform with 2 textbox objects defined for the user to enter some numbers. How do I assign these entries as variables for further calculations?
For example: The 2 entries are 'max value' and 'min value'
I want to calculate the 'difference' Here is some code but not correct obviously. (All these snippets are on the userform code)
The above snippet I don't necessarily want it in a cell but assign it to another variable
Thanks
I have a userform with 2 textbox objects defined for the user to enter some numbers. How do I assign these entries as variables for further calculations?
For example: The 2 entries are 'max value' and 'min value'
I want to calculate the 'difference' Here is some code but not correct obviously. (All these snippets are on the userform code)
Code:
Private Sub TextBox1_Change()
'First entry
MyVal1 = UserForm1.TextBox1.Value
End Sub
Code:
Private Sub TextBox1_Change()'second entry
MyVal2 = UserForm1.TextBox2.Value
End Sub
Code:
Public Function Calculations()
'calculate difference
Cells(1, 1) = MyVal1 - MyVal2
End Function
Thanks