View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Nigel Nigel is offline
external usenet poster
 
Posts: 98
Default 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