LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Repeat Error message

I am writing a macro that will search through multiple sheets in a workbook, looking for every occurence of a word. For each "hit" I copy the row containing the hit into a different workbook. The macro is structured as follows: There is one loop for each sheet. For each sheet I continue searching and copying 'til I find the first hit again. at that point I exit the loop. That loop is inside a bigger loop that cycles through all the sheets in the workbook. If there ar no hits in a worksheet, Excel creates an error. I have a "On Error GoTo Done" statement where Done: is outside the inner loop (i.e. when an error occurs I am done with that sheet and move on to the next sheet). I also reset Err = 0. This appears to work fine. When there are multiple sheets with no hits, the program crashes. It is able to catch the first error occurence, but not the second (Error 91 btw).

Any suggestions?
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error Message Box Daviv Excel Discussion (Misc queries) 1 January 25th 07 07:03 PM
Error message........ JR Excel Discussion (Misc queries) 0 July 22nd 05 09:40 AM
VBA Error Message "Compile Error...." Steve Excel Discussion (Misc queries) 3 July 15th 05 09:20 AM
changing the message in an error message The Villages DA Excel Worksheet Functions 2 February 18th 05 05:30 PM
How do I get rid of "Compile error in hidden module" error message David Excel Discussion (Misc queries) 4 January 21st 05 11:39 PM


All times are GMT +1. The time now is 10:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"