View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default On Error GoTo Doesn't Work

Check your other post.

wrote:

When the active cell doesn't have a Reference Name the "On Error GoTo
ExitMe" does not trigger but instead I get the runtime error 1004.
Could you please tell me what I am doing wrong? Thanks-

Private Sub CancelButton_Click()
Me.Hide
End Sub

Private Sub OKButton_Click()
Me.Hide
End Sub

Private Sub UserForm_Activate()
On Error GoTo ExitMe
TextBox1.Text = ActiveCell.Name.Name
GoTo Done
ExitMe:
TextBox1.Text = "Sorry this cell does not have a refrence name"
Done:
End Sub


--

Dave Peterson