Auto result of 4 TextBox value after multiplication

abid

New Member
Joined
Feb 28, 2010
Messages
33
Hello Friends,

I want to know how can I get result of 4 TextBoxes on 5th textBox after multiplying the values of 4 TextBoxes ?

textbox5 = TextBox1 * TextBox2 * TextBox3 * TextBox4

Can anyone help me out with the Script ?
you help will be highly appreciated

Thanks :)
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Hi Abid,

Try this:
Code:
Private Sub CommandButton1_Click()
    TextBox5.Value = Val(TextBox1) * Val(TextBox2) * Val(TextBox3) * Val(TextBox4)
End Sub
 
Upvote 0
Thanks for the help. I really appreciate it.

If I am looking for a result which is based of average. i.e

40 + 40 + 40 + 40 = 160 /4 = 40

if I need to do this calculation how can I do that ?
 
Upvote 0
You could try this for the average:

Code:
Private Sub CommandButton1_Click()
    TextBox5.Value = [COLOR=red][B]([/B][/COLOR]Val(TextBox1) [COLOR=red][B]+[/B][/COLOR] Val(TextBox2) [COLOR=red][B]+[/B][/COLOR] Val(TextBox3) [COLOR=red][B]+[/B][/COLOR] Val(TextBox4)[B][COLOR=red])/4[/COLOR][/B]
End Sub
 
Upvote 0
I have one more query, if anyone can help me with it please.

I want to put a condition

Textbox1 = Val(textbox2) - Val(TextBox3)

if it results in -00 then Textbox1 should result "Blank" unless the result is in +00 it doesn't show the result.
 
Upvote 0

Forum statistics

Threads
1,224,561
Messages
6,179,522
Members
452,923
Latest member
JackiG

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