View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Doug Glancy Doug Glancy is offline
external usenet poster
 
Posts: 770
Default Why is this an error?

davegb,

Change "Error" to "Err" and I belive it will work.

hth,

Doug

"davegb" wrote in message
oups.com...
The following code I copied from a book. But I always get the error
message when I select the data range in the refedit control and click
OK. Why is it never correct?

Private Sub OKButton_Click()
On Error Resume Next
Set rColHdr = Range(reDataStrt.Text)
If Error < 0 Then
MsgBox "Invalid range selection, please select the starting range
again."
On Error GoTo 0
Exit Sub
End If
uf1021Mid.Hide
End Sub

Thanks!