Adding two or more cells for a TextBox value

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,347
Office Version
  1. 365
Platform
  1. Windows
Is there a way to have a TextBox equal the values of two or more cells added together

I tried this, but it just concatenated the two values and didnt add them.

TextBox155.Value = Sheets("Pricing Sheet Compilation").Range("R27").Text + Sheets("Pricing Sheet Compilation").Range("R28").Text
 

Excel Facts

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

Code:
TextBox155.Value = Val(Sheets("Pricing Sheet Compilation").Range("R27").Text) + Val(Sheets("Pricing Sheet Compilation").Range("R28").Text)
 
Upvote 0
I have a user form that has 4 textboxes ( textbox 1 , 2 , 3 , 4 ).<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p></o:p>

textbox1 is entered by the user.<o:p></o:p>
textbox2 is entered by the user.<o:p></o:p>
textbox3 is extracting the value from a sheet cell.<o:p></o:p>
textbox4 is extracting the value from a sheet cell ( that is the sum of all the 3 boxes).<o:p></o:p>
<o:p></o:p>

The problem is that , in order to display the correct value in textbox4 I have to exit the userform and call it again.
<o:p></o:p>
<o:p></o:p>
It is not dynamically updating textbox4 as they are entered in the textbox1 and 2, and textbox3 value extracted from the sheet cell.
<o:p></o:p>
Any workaround to this ?<o:p></o:p>
<o:p></o:p>
Thank you.<o:p></o:p>
<o:p></o:p>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,828
Members
452,946
Latest member
JoseDavid

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