ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   MSGBOX UPON ERROR (https://www.excelbanter.com/excel-programming/402137-msgbox-upon-error.html)

FARAZ QURESHI

MSGBOX UPON ERROR
 
Hello every1,

I am trying to write a code but also am facing error 1004 at quite some times.

Can anyone help me in writing a proper line of code for a Msgbox displayed
upon occurance of such an error and going to the end of the remaining code so
as to avoid debugging and reminding a simple mistake to be avoided.

Message Box Displaying "Please copy something first!"

Charles Chickering

MSGBOX UPON ERROR
 
Sub SimpleErrorHandling()
On Error GoTo ErrorHandler
'Your code

ErrorHandler:
MsgBox "Your Message"
End Sub
--
Charles Chickering

"A good example is twice the value of good advice."


"FARAZ QURESHI" wrote:

Hello every1,

I am trying to write a code but also am facing error 1004 at quite some times.

Can anyone help me in writing a proper line of code for a Msgbox displayed
upon occurance of such an error and going to the end of the remaining code so
as to avoid debugging and reminding a simple mistake to be avoided.

Message Box Displaying "Please copy something first!"


FARAZ QURESHI

MSGBOX UPON ERROR
 
Thanx Charles

No doubt found your xclent example better than two advices, pal!

Thanx again!

"FARAZ QURESHI" wrote:

Hello every1,

I am trying to write a code but also am facing error 1004 at quite some times.

Can anyone help me in writing a proper line of code for a Msgbox displayed
upon occurance of such an error and going to the end of the remaining code so
as to avoid debugging and reminding a simple mistake to be avoided.

Message Box Displaying "Please copy something first!"



All times are GMT +1. The time now is 12:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com