Errors

  • Thread starter Thread starter Jason McGidden
  • Start date Start date
J

Jason McGidden

I have designed a macro to use for my department, As it is
prone to falling down from time to time ie when data is
where it shouldnt be it sometimes stops in the middle of
the procedure and gives the debug menu, because this is
being used by a lot of people (most of who dont know any
vb) I do not want them to see the code or error messages.
Is it possible for me to make somekind of code that when
an error happens that I get a pop up box with the name of
the macro where the error occured and the name of the
error and then an ok button which should end the
procedure. Also I have 3 macros in the workbook - is it
possible to include this code so it applies to all of the
macros or will i have to add it for every macro?

THanks
 
Hi Frank
I looked at the help file and came up with the following
code to see if it works but i am little confused by whats
happening. I get a standard error message ie subscript out
of range. Does this error statement only relate to cetain
errors?

Sub Testerror()

On Error GoTo errorscript
Worksheets(X).Select

errorscript: MsgBox "An unexpected error has occurred."

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top