Thread: User message
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default User message

Dim rng As Range, x As Single
Dim wsquote As Worksheet
Set wsquote = Worksheets("sheet1")
On Error Resume Next
Set rng = wsquote.Range("knife2")
If Err.Number = 0 Then
x = rng.Rows.Count
wsquote.Range("knife2").ClearContents
rng.Offset(0, 0).Resize(x).EntireRow.Delete
'Sheets("sheet 1").Range("range").ClearContents
Else
MsgBox "have already deleted the range'"
End If


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"gavmer " wrote in message
...
Hi Bob,

Good to hear from you. I tried your code but no error message was
presented. How do i get the error message 'you have already deleted the
range' to appear if the range is no longer.

??????

Cheers!!!!!


---
Message posted from http://www.ExcelForum.com/