Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error handler help
Hi,
i am new to VB code but seem to be getting ok okish. i do however have a problem with a routine. i press a button to email my contact in the excel w/book. if there is a mail there, it sends etc. if the specific cell is empty, it returns an error which i have to debug. can any one help me with a handler for this. Here is mine but its not very good and prbably not correct.( my email address appears in D12) on Error GoTo ErrorHandler1 ( at top of routine ) End If Range ("D12") = "" GoTo ErrorHandler1 Exit Sub ErrorHandler1: MsgBox ("Contact must have email address"), , _ " Contacts message" End Sub help would be well received :) Nigel |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error handler help
Hi Nigel,
Try this: If Range ("D12") = "" Then MsgBox ("Contact must have email address"), , _ " Contacts message" Exit Sub Else 'Your instructions to send e-mail here End If Reagrds, KL "Nigel" wrote in message ... Hi, i am new to VB code but seem to be getting ok okish. i do however have a problem with a routine. i press a button to email my contact in the excel w/book. if there is a mail there, it sends etc. if the specific cell is empty, it returns an error which i have to debug. can any one help me with a handler for this. Here is mine but its not very good and prbably not correct.( my email address appears in D12) on Error GoTo ErrorHandler1 ( at top of routine ) End If Range ("D12") = "" GoTo ErrorHandler1 Exit Sub ErrorHandler1: MsgBox ("Contact must have email address"), , _ " Contacts message" End Sub help would be well received :) Nigel |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error handler help
Hi,
Exactly what i was looking for. Thank you :) Nigel "KL" wrote: Hi Nigel, Try this: If Range ("D12") = "" Then MsgBox ("Contact must have email address"), , _ " Contacts message" Exit Sub Else 'Your instructions to send e-mail here End If Reagrds, KL "Nigel" wrote in message ... Hi, i am new to VB code but seem to be getting ok okish. i do however have a problem with a routine. i press a button to email my contact in the excel w/book. if there is a mail there, it sends etc. if the specific cell is empty, it returns an error which i have to debug. can any one help me with a handler for this. Here is mine but its not very good and prbably not correct.( my email address appears in D12) on Error GoTo ErrorHandler1 ( at top of routine ) End If Range ("D12") = "" GoTo ErrorHandler1 Exit Sub ErrorHandler1: MsgBox ("Contact must have email address"), , _ " Contacts message" End Sub help would be well received :) Nigel |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Error handler | Excel Discussion (Misc queries) | |||
Error Handler Question | Excel Discussion (Misc queries) | |||
Error Handler | Excel Discussion (Misc queries) | |||
Error Handler | Excel Programming | |||
error handler | Excel Programming |