ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Adding values in textboxes... (https://www.excelbanter.com/excel-programming/305158-re-adding-values-textboxes.html)

Tom Ogilvy

Adding values in textboxes...
 
In the Exit Event of each textbox put in the code

rivate Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Textbox4.Text = Format(clng(textbox1) + clng(textbox2) +
clng(textbox3),"0")
End Sub

Repeat for Textbox2 and Textbox3

You can also use the afterupdate event.

Change clng to csng if the numbers will be decimals/fractions.

--
Regards,
Tom Ogilvy

"Gary Phillips" wrote in message
...
I've got four textboxes... The first three are enabled, the fourth is not.

I want the user to be able to enter an integer value into the first three

and it will add those three values into the fourth box. I do not want the
user to have to press any buttons, I want it to update as the user goes
along.

How can I do this?

Thanks,

Gary





All times are GMT +1. The time now is 01:50 PM.

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