Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Displaying error messages
Will,
You can trap for the error, and display the error message in your error handling block. E.g, Sub Test() On Error GoTo ErrHandler: ' ' your code here ' Exit Sub ErrHandler: MsgBox "The following error occured: " & vbCrLf & _ Err.Number & " - " & Err.Description End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel www.cpearson.com "Will" wrote in message ... Hi Folks My apologies if this has been posted before - does anyone know of any code which I could use to display an error message instead of the dreaded 'debug error' box? I am able to display a message box which alerts the user to the fact that an error has occured - can I show the error within this message box? Any help appreciated. Thanks in advance. Will |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Displaying error messages
Thanks for that Chip, it worked a treat.
Regards Will -----Original Message----- Will, You can trap for the error, and display the error message in your error handling block. E.g, Sub Test() On Error GoTo ErrHandler: ' ' your code here ' Exit Sub ErrHandler: MsgBox "The following error occured: " & vbCrLf & _ Err.Number & " - " & Err.Description End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel www.cpearson.com "Will" wrote in message ... Hi Folks My apologies if this has been posted before - does anyone know of any code which I could use to display an error message instead of the dreaded 'debug error' box? I am able to display a message box which alerts the user to the fact that an error has occured - can I show the error within this message box? Any help appreciated. Thanks in advance. Will . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Error Messages | Excel Worksheet Functions | |||
Error messages | Excel Discussion (Misc queries) | |||
Error Messages | Excel Worksheet Functions | |||
Error Messages | Excel Worksheet Functions | |||
Displaying Messages | Excel Discussion (Misc queries) |