Can you detect if and excel find and replace is active during worksheet_change()?

Posted by John Griffiths on Stack Overflow See other posts from Stack Overflow or by John Griffiths
Published on 2010-03-11T16:40:11Z Indexed on 2010/03/11 18:34 UTC
Read the original article Hit count: 185

Filed under:

Hi I've just crashed excel using amazon spreadsheet to update feed.

When doing find and replace [replace all] with 2 cells selected after the first replacement the worksheet_change() function finished with the whole spreadsheet selected. This meant that the replacements took place outside of the original area. Unfortunatly the replcement text included the find text and each replacement re-selected the entire area excel ran until it ran out of space then crashed.

Pressing control-break brings up the vba dialog STOP/CONTINUE/DEBUG. DEBUG is greyed out as amazon had protected the sheet. STOP would stop one run but would then continue to crash. CONTINUE would switch back to the current change and continue to crash.

Is there any way to detect if a find&replace operation is in action whilst executing excel vba?

Regards John

© Stack Overflow or respective owner

Related posts about excel