LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default easy vba question

Take a look at VBA's help for "On Error". You'll see this:

Enables an error-handling routine and specifies the location of the routine
within a procedure...

So you're off to some place within that same procedure.


Maybe you could use:

Option Explicit
Sub yoursub()

On Error GoTo ThisProcedureErrorHandling:

'your code here

Exit Sub 'avoid the error handler


ThisProcedureErrorHandling:
Call error_h
'or
'Call error_handling.error_h
Resume Next '???
End Sub

and in the error_handling module:

Option Explicit
Sub error_h()
MsgBox Err.Number
Err.Clear
End Sub



"Pierre via OfficeKB.com" wrote:

Hi tom,

i now have:

- a workbook open sub in which the first line should be : on error goto
error_h

error_h() is in the module error_handling

ho can i get the on error goto routine to start error_h in module
error_handling ?

When i try my code i get the message:
"name not defined"

Thanks,
Pierre

Tom Ogilvy wrote:
You can run Sub's or Function's. Modules contain Sub's and Function's

Hi norman,

[quoted text clipped - 19 lines]
Any ideas?
ThanksPierre


--
Message posted via http://www.officekb.com


--

Dave Peterson


 
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
Easy question (just not for me) Confusicous Excel Discussion (Misc queries) 2 January 4th 10 08:20 PM
probably an easy question Jason Excel Discussion (Misc queries) 4 February 7th 08 05:39 PM
Easy Question M&M[_2_] Excel Discussion (Misc queries) 3 July 24th 07 12:34 AM
new user with easy question? not easy for me speakeztruth New Users to Excel 5 June 3rd 05 09:40 PM
easy question .... i think Dean Excel Discussion (Misc queries) 1 January 6th 05 06:31 PM


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