With the following, how would i amend to include range "unit333" on
sheet "t800"?????
Private Sub CommandButton6_Click()
Dim rng As Range, x As Single
Dim wsquote As Worksheet
Set wsquote = Worksheets("t800")
On Error Resume Next
Set rng = wsquote.Range("unit333")
If Err.Number = 0 Then
x = rng.Rows.Count
Worksheets("sheet1").Unprotect Password:="jenjen1"
wsquote.Range("knife3").ClearContents
rng.Offset(0, 0).Resize(x).EntireRow.Delete
Else
MsgBox "You have already deleted Unit 3"
End If
Worksheets("sheet1").Protect Password:="jenjen1"
End Sub
Not sure about knife3
--
Regards,
Tom Ogilvy
"gavmer " wrote in message
...
Hi all,
With the following, how would i amend to include range "unit333" on
sheet "t800"?????
Private Sub CommandButton6_Click()
Dim rng As Range, x As Single
Dim wsquote As Worksheet
Set wsquote = Worksheets("sheet1")
On Error Resume Next
Set rng = wsquote.Range("unit356")
If Err.Number = 0 Then
x = rng.Rows.Count
Worksheets("sheet1").Unprotect Password:="jenjen1"
wsquote.Range("knife3").ClearContents
rng.Offset(0, 0).Resize(x).EntireRow.Delete
Else
MsgBox "You have already deleted Unit 3"
End If
Worksheets("sheet1").Protect Password:="jenjen1"
End Sub
???????????
CHeers!!!!!!!!
---
Message posted from http://www.ExcelForum.com/