PDA

View Full Version : URGENT!!! How to detect whether a value is convertible or not using the Cxxx()



sorinvoinea
11-14-2007, 04:38 AM
...functions?

They only give error messages if they are given non-numeric parameters.

Also, using IsNumeric() doesn't work. I have a value like "0,30,0,35" and obviosly it can not be converted to any numeric type.

Thanks. :beerchug:

unmarkedhelicopter
11-14-2007, 04:45 AM
Is this URGENT !!! like the last one was URGENT !!!

Bob Phillips
11-14-2007, 05:26 AM
I am sure there is a question in there somewhere, but I'll be blowed if I can see it.

With that and the strident URGENCY!!! of your subjects means that you are in danger of destroying any goodwill towards you sunshine. People won't even bother trying to answer your posts.

sorinvoinea
11-14-2007, 05:35 AM
the question is in the subject... I appologize... continued with the word "functions" in the messag body. I hope it's clear now.

SOOORRRRYYYYY :banghead:

Dr.K
11-14-2007, 05:55 AM
Yeah man, the urgency thing is super annoying...
If its that urgent, go buy some books or pay a consultant.

However, I think I understand what you are asking, and I was just thinking about this the other day. I think the answer is to build a function that uses error trapping/surpression, just like the classic "workbook open" function:

WorkBookOpen(WorkBookName as string) as boolean

Basically, just use the function and check for an error. For something like Cstr that has different error conditions, you could use a Select Case.

Bob Phillips
11-14-2007, 06:23 AM
How about

=ISNUMBER(--D1)

rory
11-14-2007, 06:39 AM
I presume you are only talking about the numeric conversion functions? You could try using Val instead, or in conjunction.