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: 8
Default Macro Error Handling

I have recorded a Macro and I am modifying it(easiest way for me to learn).
However I have run into a situation I can not find a solution in any
documentation.

Basically I have series of "cells.find" in sheet 1 of a workbook followed by
a copy and paste to sheet 2 in the workbook.

All is well if I find all the information I am trying to find with the
cells.find.

Before each "cells.find" I have inserted a statement "On Error goto Label1"
or Label2, etc.

Basically I am skipping the copy and paste and looking for the next
information I need with the next "cells.find" .

The first time I perform a "cells.find" and do not find the required
information I branch correctly to the next part of the macro that does
another "cells.find".

If I encounter another error condition the macro does not take the branch to
On Error GoTo Label20. It generates a run time error (91).

I have added "err.Clear" and "On Error GoTo 0" but I still get a runtime
error on the second failure of the "cells.find".

I can not get the Macro to reset the "On Error GoTo Labeln".

Does anyone have any suggestions on how to remedy this situation. I believe
there may be some Pure VB solutions but I don't think I am ready to tackle
them yet when I can't even get this "dumb" macro to work.

Thank you in advance for your assistance.

Greg


 
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
Need a Error Handling for this Macro [email protected] Excel Discussion (Misc queries) 2 June 4th 09 07:58 AM
Error Handling Problem calling Macro from Other Worksheet Marcelo Chou Excel Programming 6 September 4th 07 01:05 PM
Error handling in macro michaelberrier Excel Discussion (Misc queries) 7 May 23rd 06 09:33 PM
Error Handling - On Error GoTo doesn't trap error successfully David Excel Programming 9 February 16th 06 05:59 PM
Error handling with a handling routine ben Excel Programming 0 March 15th 05 03:01 PM


All times are GMT +1. The time now is 05:39 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"