Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Run-time error 91

  1. #1
    New Member
    Join Date
    May 2002
    Location
    Western Australia
    Posts
    25
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    When I am using the following line of code I sometimes get a Run-time error 91 error.

    Columns("A").Findnext().Activate

    It doesn't happen every time but when it does I have to re-start Excel.

    It seems like something needs resetting.

    I can often get it to err after running a completely seperate macro in the same worksheet.

    Can anyone suggest something?


    [ This Message was edited by: Trevor Wood on 2002-05-05 23:15 ]

  2. #2
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-05-05 22:44, Trevor Wood wrote:
    When I am using the following line of code I sometimes get a Run-time error 91 error.

    Columns("A").Findnext.Activate

    It doesn't happen every time but when it does I have to re-start Excel.

    It seems like something needs resetting.

    I can often get it to err after running a completely seperate macro in the same worksheet.

    Can anyone suggest something?
    This Error used with the FindFunction is typical of Not having the Findfunction
    find anything either beacuse you haven't initialised a value to find OR you there the
    function has not found a value to search for.
    Either way you can Trap this error with
    On Error resume Next and then check for
    an error and do something....eg

    Without knowing your full code...


    Sub tt()
    On Error Resume Next
    Columns("A").FindNext.Activate
    If Err Then MsgBox "Nothing found!": On Error GoTo 0

    End Sub


    This Error however should cause Excel to
    to become unstable and have you shut it down ??

    What other code are you using in conjuction with this ??

    Kind Regards,
    Ivan F Moala From the City of Sails

Some videos you may like

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
  •