Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
don don is offline
external usenet poster
 
Posts: 21
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default 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
.

Reply
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 handler linto Excel Discussion (Misc queries) 1 February 11th 10 12:17 PM
Error Handler sharad Excel Discussion (Misc queries) 1 September 17th 07 06:38 PM
Error Handler Not Working Bill Excel Discussion (Misc queries) 0 August 25th 05 07:13 PM
Error Handler dht[_2_] Excel Programming 5 August 19th 04 08:51 AM
error handler Fleur Excel Programming 1 November 20th 03 06:06 AM


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