Excel Macros Add Multiply and Divide

mehul13

New Member
Joined
Dec 3, 2014
Messages
6
Hello everyone,
I want to perform the following function

Like i have a value on my Base price text box i.e 2500
I have a value in my Tax amount i.e 2%
Now i want my Total textbox to print the value of ((2500 + (2500*2/100))
How do i do it..?
Please Help

I tried something but its now happening
Thank you in advance
My Code is


Code:
Private Sub Textbaseprice_Change()


End Sub


Private Sub Texttaxamount_Change()



End Sub


Private Sub Texttaxes_Change()
If Me.Texttaxes = "CST" Then Me.Texttaxamount = "2%" Else Me.Texttaxamount = "15.6%"


End Sub


Sub GetSum()
On Error Resume Next
Me.Texttotal = (IIf(Me.Textbaseprice = "", 0, Me.Textbaseprice) + 0) + (IIf(Me.Texttaxamount = "", 0, Me.Texttaxamount) + 0)
End Sub


Private Sub Texttotal_Change()
If Me.Texttaxeamount = "" Then Me.Textttotal = "" Else Me.Texttotal = "Call Totalin"

End Sub


Sub Totalin()
Dim total As Double
total = Val(Textbaseprice.Value) + (Val(Textbaseprice.Value) * Val(Texttaxamount.Value) / 100)
Me.Textbaseprice.Value = ""
Me.Texttotal.Value = total
End Sub
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Could you please elaborate your issue as more?

is this you required the ans. in textbox3?
 
Upvote 0
Could you please elaborate your issue as more?

is this you required the ans. in textbox3?

Yes.. I wanted that the final ans
((2500)+(2500*2/100))
Comes in textbox3
Actually
Textbox1 has value 2500
Textbox2 has 2%
So
Textbox3 should give an ans automatically of
((2500)+(2500*2/100))
 
Upvote 0
Yes.. I wanted that the final ans
((2500)+(2500*2/100))
Comes in textbox3
Actually
Textbox1 has value 2500
Textbox2 has 2%
So
Textbox3 should give an ans automatically of
((2500)+(2500*2/100))

you can place this in your command button_click method,

TextBox3.Value = (TextBox1.Value + (TextBox1.Value * TextBox2.Value / 100))
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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