![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: May 2002
Location: Western Australia
Posts: 25
|
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 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Quote:
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 ?? |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|