Advertisement
Advertisement
| 06.26.2008 at 03:47PM PDT, ID: 23520109 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: |
Option Explicit
Public Sub DeleteExtra()
Dim c As Range
With Worksheets("Sheet2").Cells
Set c = .Find(What:="CSALLRMSCHD*", LookAt:=xlPart, After:=ActiveCell, LookIn:=xlFormulas, SearchDirection:=xlNext)
If Not c Is Nothing Then
Do
i = c.Row
Call DeleteBlock(i)
Set c = .FindNext(c)
Loop While Not c Is Nothing
End If
End With
End Sub
Private Sub DeleteBlock(i)
Dim myUnion As Range
Set myUnion = Union(Rows(i), Rows(i + 1), Rows(i + 2), Rows(i + 3), Rows(i + 4), Rows(i + 5), Rows(i + 6), Rows(i + 7), Rows(i + 8))
myUnion.EntireRow.Delete
End Sub
|