Sum up textboxes on userform that are updated by afterupdate code

sueanne

Board Regular
Joined
Apr 2, 2014
Messages
81
Hi all,

I have 10 text boxes names "Total1-10" that are updated with the following code.

Code:
Private Sub cboIC1_AfterUpdate()
If UP1.Value = "" Then Exit Sub
Total1.Value = Format((Qty1.Value * UP1.Value), "$#,##0.00")
End Sub

I now want to add up the 10 text boxes in another text box "Subttl" and return it as a $0.00 value. I have the following code in at the moment

[CODE]
Private Sub Total1_AfterUpdate()
Subttl.Value = "$" & Val(Total1) + Val(Total2) + Val(Total3) + Val(Total4) + Val(Total5) + Val(Total6) + Val(Total7) + Val(Total8) + Val(Total9) + Val(Total10)
End Sub

The Subttl text box doesn't update, unless I manually type in the value to the "Total" text boxes. How do I make it update automatically once the "Total" textboxes are populated?

I have tried the above code, also tried the _change() action and neither seem to auto populate the Subttl textbox. 

I have looked at quite a few different examples on here, including putting a function in called oSum in Module and then calling that in Private Sub Total1_change() but that didn't work either.

Any help would be greatly appreciated! :)
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Forum statistics

Threads
1,215,201
Messages
6,123,621
Members
449,109
Latest member
Sebas8956

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