Thread: User message
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
gavmer[_47_] gavmer[_47_] is offline
external usenet poster
 
Posts: 1
Default User message

Hi all,

Im using the code below to delete a range. What i would also like i
once the range has been deleted, if the user clicks the buttin again
an error message 'you have already deleted this range
appears....rather than a debug message.

How would i do this??

Cheers all!!!!

Private Sub CommandButton5_Click()
Dim rng As Range, x As Single
Dim wsquote As Worksheet
Set wsquote = Worksheets("sheet1")
Set rng = wsquote.Range("knife2")
x = rng.Rows.Count
wsquote.Range("knife2").ClearContents
rng.Offset(0, 0).Resize(x).EntireRow.Delete
'Sheets("sheet 1").Range("range").ClearContents
End Su

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