userform calculator

lpking2005

Board Regular
Joined
Mar 21, 2011
Messages
140
need a little help,

I need a simple calculator, so when you put for `example, 4000` in the textbox, it will divide it by a number, `example, 288`. which is in cell (M29)
I need it to do this because the cell will most likely be changing values every once in awhile.

5588906688_387b46a900.jpg
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Change the names of the controls to suit:

Code:
Private Sub CommandButton1_Click()
    TextBox2.Value = Val(TextBox1.Value) / Range("M29").Value
End Sub
 
Upvote 0
Many Thanks!

It works but when i rename one of them to textbox2, the total does not show up in the secont text box.

i would like the value i enter to stay in textbox1,
then total to appear in text box 2.
 
Upvote 0
sorry ignore that, its working now!

my silly mistake, all this code i keep looking at today is confusing me. :(:biggrin:
 
Upvote 0

Forum statistics

Threads
1,224,524
Messages
6,179,308
Members
452,904
Latest member
CodeMasterX

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