Sum Function in Userform

joacro

Board Regular
Joined
Jun 24, 2010
Messages
158
Hi All,

I have a userform which will work as a calculator.
In the one box the user need to insert an amount and then in the other box I need the formula to kick in.

Ex: The form is PointsCal. The input box is Fitness and the box where the formula is is Textbox27

What I did:
Private Sub TextBox27_Change()
TextBox27.Value = Fitness.Value * 7500
End Sub

Nothing happens.
I need the value to be desplayed in Textbox27

Hope someone can help with this

Regards
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
You may wish to try the exit function of the textbox you are entering a value in, something like:
Code:
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
    If IsNumeric(TextBox1.Value) Then
        TextBox2.Value = Format(CDbl(TextBox1.Value) * 7500, "#.00")
    End If
End Sub
 
Upvote 0
I think that instead of this event header for your code...

Private Sub TextBox27_Change()

that you actually will want this one...

Private Sub Fitness_Change()

as that is the TextBox that is being changed by the user.
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,831
Members
452,946
Latest member
JoseDavid

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top