ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   TextBox calculation (https://www.excelbanter.com/excel-programming/333922-textbox-calculation.html)

johncassell[_2_]

TextBox calculation
 

Hello,

I have 3 textboxes (Labour, Materials and Total)

I am trying to get the totalcharge textbox to show sum of labour +
materials after labour change and/or materials change but it this is
what happens:

Labour = £10.00
Materials = £5.00
Total = £10.005 (Instead of just £15.00)
and if i tab back up to the labour box the totalcharge value changes
again to £10.00£5.00

my code is:


Private Sub Labour_AfterUpdate()
TotalCharge.Text = Labour.Value + Materials.Value
Labour.Text = Format(Labour.Value, "£###,,###.00")
End Sub
Private Sub materials_AfterUpdate()
TotalCharge.Text = Labour.Value + Materials.Value
Materials.Text = Format(Materials.Value, "£###,,###.00")
End Sub

I'm not really sure when to use .text or .value either
any help would be really appreciated!!

thanks


--
johncassell
------------------------------------------------------------------------
johncassell's Profile: http://www.excelforum.com/member.php...o&userid=25016
View this thread: http://www.excelforum.com/showthread...hreadid=385423



All times are GMT +1. The time now is 06:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com