View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Addition to existing code

Private Sub CommandButton6_Click()
Dim rng As Range, rng1 as Range
Dim wsquote As Worksheet
Dim wsquote1 as Worksheet
set wsquote = Worksheets("sheet1")
Set wsQuote1 = Worksheets("t800")
On Error Resume Next
Set rng = wsquote.Range("unit356")
Set rng1 = wsQuote.Range("unit333")
If Err.Number = 0 Then
wsquote.Unprotect Password:="jenjen1"
wsquote1.Unprotect Password:="jenjen1"
wsquote.Range("knife3").ClearContents
rng.EntireRow.Delete
rng1.EntireRow.Delete
wsquote.Protect Password:="jenjen1"
wsquote1.Protect Password:="jenjen1"
Else
MsgBox "You have already deleted Unit 3"
End If

End Sub

--
Regards,
Tom Ogilvy

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

Thank you for that but i was hoping to incorporate that as an addition
to the existing code so that it deleted 2 ranges from 2 sheets????

Any ideas???

Cheers!!!!


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