View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Sum that ignores text

MsgBox Val(TextBox1.Text) + Val(TextBox2.Text)

works for me

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Smurfette18" wrote in message
ps.com...
Hi,

I am trying to do a simple sum using inputs taken from userform
comboboxes. The problem is that the inputs can contain the text
character "-", and this is causing an error. I have tried converting
the inputs to values using val, cval, cdec, etc, but I think that the
problem is that the application.sum function in VBA, like the simple
operation "+", can't handle text. Any ideas about how to deal with
this?

Thanks!
-Tim