Consulting

Results 1 to 7 of 7

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

  1. #1

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

    ...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.

  2. #2
    Is this URGENT !!! like the last one was URGENT !!!
    2+2=9 ... (My Arithmetic Is Mental)

  3. #3
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    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.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  4. #4
    the question is in the subject... I appologize... continued with the word "functions" in the messag body. I hope it's clear now.

    SOOORRRRYYYYY

  5. #5
    VBAX Contributor
    Joined
    Jun 2007
    Posts
    150
    Location
    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.

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    How about

    =ISNUMBER(--D1)
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  7. #7
    VBAX Master
    Joined
    Jun 2007
    Location
    East Sussex
    Posts
    1,110
    Location
    I presume you are only talking about the numeric conversion functions? You could try using Val instead, or in conjunction.
    Regards,
    Rory

    Microsoft MVP - Excel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •