Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have three textboxes:
Contents Premium name:contents Bldg Premium name:bldg Total Premium name:total Total.Value = Contents.Value + Bldg.Value When I add the above line to calculate the total premium, it does not add, it concatenates. eg. if I put 10000 in Contents Premium and 50 in Bldg Premium, ideally it should show 10050 but it is showing 1000050 Total.Value = Contents.Value - Bldg.Value The above line for subtracting works fine. Any ideas??? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Total.Value = Sum(Contents.Value, Bldg.Value)
wrote in message ps.com... I have three textboxes: Contents Premium name:contents Bldg Premium name:bldg Total Premium name:total Total.Value = Contents.Value + Bldg.Value When I add the above line to calculate the total premium, it does not add, it concatenates. eg. if I put 10000 in Contents Premium and 50 in Bldg Premium, ideally it should show 10050 but it is showing 1000050 Total.Value = Contents.Value - Bldg.Value The above line for subtracting works fine. Any ideas??? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Your TEXT boxes contain text, so VBA will add the two text strings
together as you have requested - two options for you (1) store the results of the textboxes on the worksheet and have a formula to sum them (2) amend your code to be total.value=val(contents.value)+val(Bldg.Value) wrote: I have three textboxes: Contents Premium name:contents Bldg Premium name:bldg Total Premium name:total Total.Value = Contents.Value + Bldg.Value When I add the above line to calculate the total premium, it does not add, it concatenates. eg. if I put 10000 in Contents Premium and 50 in Bldg Premium, ideally it should show 10050 but it is showing 1000050 Total.Value = Contents.Value - Bldg.Value The above line for subtracting works fine. Any ideas??? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Addition? | Excel Discussion (Misc queries) | |||
Sum vs. Addition | Excel Programming | |||
addition | New Users to Excel | |||
row addition | Excel Worksheet Functions | |||
Addition to code | Excel Programming |