IsError?
IsError?
Thanks Thanks:  0
Likes Likes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: IsError?

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Posts
    97
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    Can I use the excel IsError function in VBA code? I have a refresh timer running every five secs, and from time to time, some cells contain !NULL#. This is a result of a add-in bug. I am checking for the string "!NULL#" right now, but it doesn't seem to work. I'm using something like:
    if cells(6, 1).value = "!NULL#" then
    do something
    else
    do something else
    end if
    Any ideas?

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Austin, Texas USA
    Posts
    11,654
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Perhaps it's because the error is...

    #NULL!

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Posts
    97
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Sorry, that was a typo in the post, my code is checking for "#NULL!"...

  4. #4
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Austin, Texas USA
    Posts
    11,654
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    ...but, Excel error values are not text strings. "#NULL!" is quite different from #NULL!.

  5. #5
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi
    If using VBA, Excel will return a value of
    Error 2000 if the cell contains the #NULL!
    error.
    Here's a few other returns:

    #NULL! Error 2000
    #NAME? Error 2029
    #DIV/0! Error 2027
    #VALUE! Error 2015
    #NUM! Error 2036

    Tom

    [ This Message was edited by: TsTom on 2002-04-02 07:23 ]

  6. #6
    Board Regular
    Join Date
    Feb 2002
    Posts
    97
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I'm sorry, maybe I'm dumb, but I'm not following. Are you saying I should be doing
    If cells(6, 1).value = #NULL! then
    do something
    end if
    ?
    And what about this Error 2000 thing, how do I use that as far a code goes... Sorry guys, maybe I should go grab another coffe...
    ?

    [ This Message was edited by: charlie79 on 2002-04-02 07:21 ]

  7. #7
    Board Regular
    Join Date
    Feb 2002
    Posts
    97
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    OK, I'm equipped with a fresh coffee... Bring on the suggestions!!!

  8. #8
    Board Regular
    Join Date
    Feb 2002
    Posts
    97
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Should I get another coffee???

  9. #9
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi
    If #NULL! is the only error value you are concerned with than this might work for you.

    In your example:

    if cells(6, 1).value = "!NULL#" then
    do something
    else
    do something else
    end if

    The below will return "Error" if an error
    is in the cell.
    I do not know how to distinguish between
    different errors?

    Dim MyType As String
    MyType = TypeName(Cells(6, 1).Value)
    If MyType = "Error" Then
    'do something
    Else
    'do something else
    End If

    Good Luck!
    Tom



  10. #10
    Board Regular
    Join Date
    Feb 2002
    Posts
    97
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Sorry, but will that not simply check for the actual string "Error" in that cell?

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com