Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Terry,
One way, perhaps: Dim v1, v2, v3, v4 v1 = Replace(txtadmingross.Text, "$", "") v2 = Replace(txtGross.Text, "$", "") v3 = Replace(txtF1.Text, "$", "") If IsNumeric(v1) Then v1 = CDbl(v1) Else v1 = 0 End If If IsNumeric(v2) Then v2 = CDbl(v2) Else v2 = 0 End If If IsNumeric(v3) Then v3 = CDbl(v3) Else v3 = 0 End If txtadmingross.Text = Format(txtadmingross.Text, "$#,##0") txtTotalGross.Text = Format(v1 + v2 + v3, "$#,##0") --- Regards, Norman "Terry K" wrote in message oups.com... Thank you very much Norman. That does work but it does lead to another question - Originally in my initalize statement I had all text boxes = empty (used also for a cmd button to clear all text boxes). In this state when I entered my first value I would get run time error 13, type mismatch, on the two text boxes that were empty. I changed the initalize statement to set these 3 to zero and it works great. Is there anyway around this? Just in terms of appearance - It might look better if all text boxes were blank rather than some being blank and others having zeros. Thanks Terry |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Perfect then. Thank you very much. I will give that a try this
afternoon. Thank you very much for your help. Terry |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding values in textboxes? | Excel Programming | |||
Adding values in textboxes? | Excel Programming | |||
Adding values in textboxes... | Excel Programming | |||
Adding values in textboxes... | Excel Programming | |||
Adding the values of 2 textboxes | Excel Programming |