ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   error handler in macro? (https://www.excelbanter.com/excel-programming/312685-error-handler-macro.html)

don

error handler in macro?
 
Want to do a selection.find on a column. How do I return
processing to macro if selection is NOT found?

THANKS

Frank Kabel

error handler in macro?
 
Hi
try
dim c as range
on error resume next
set C = range("A:A").find ....
on error goto 0
if not c is nothing then
'your code
end if

--
Regards
Frank Kabel
Frankfurt, Germany

"Don" schrieb im Newsbeitrag
...
Want to do a selection.find on a column. How do I return
processing to macro if selection is NOT found?

THANKS



Pete McCOsh

error handler in macro?
 
Enclose the relevant code in the following:

On error Resume Next

...Your code here..

On error GoTo 0

The first line forces execution to continue from the next
line if an error occurs and the second returns to normal
error-trapping.

You might want to make sure the rest of the code in this
block is robust before doing this, or you may end up with
some pretty wild results...

Cheers, Pete

-----Original Message-----
Want to do a selection.find on a column. How do I return
processing to macro if selection is NOT found?

THANKS
.



All times are GMT +1. The time now is 05:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com