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


JJD,
Have your On Error GoTo statement point to a specific line in th
sub where you are trying to trap the error, such as:

On Error GoTo errhndlr

Then at the bottom of your sub put the following

Exit Sub
errhndlr:
' - Then put whatever code you want to run if the error occurs
' - The IF statement in your case
' - IF your condition is true then use END to quit the entire macro

Be sure to have Exit Sub before your error handler so it will not ru
unless an error occurs.
Also make sure your errhndlr: line starts all the way to the left (i
not indented) and that it ends with the colon :

HT

--
bhofset
-----------------------------------------------------------------------
bhofsetz's Profile: http://www.excelforum.com/member.php...fo&userid=1880
View this thread: http://www.excelforum.com/showthread.php?threadid=38134

 
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
On Error Goto ignored Fred Smith Excel Programming 4 January 8th 05 03:49 AM
On Error Goto doesn't goto Paul Excel Programming 1 October 15th 04 03:51 PM
On Error Goto doesn't goto Paul Excel Programming 0 October 15th 04 03:05 PM
On Error GoTo StanJ[_2_] Excel Programming 1 July 31st 04 06:15 PM
On error goto 0? Brian Tozer Excel Programming 10 December 29th 03 09:59 PM


All times are GMT +1. The time now is 04:27 AM.

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"