Here is an example of what I have and what I would like to accomplish.
[TABLE="width: 314"]
<tbody>[TR]
[TD="width: 418, bgcolor: transparent, colspan: 3"]OPEN WORK REPORT
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: transparent"]Period
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: #D9D9D9"]NUMBER
[/TD]
[TD="width: 204, bgcolor: #D9D9D9"]WORK ORDER
[/TD]
[TD="width: 124, bgcolor: #D9D9D9"]DESCRIPTION
[/TD]
[/TR]
[TR]
[TD="width: 204, bgcolor: #D9D9D9"]TYPE
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25524484
[/TD]
[TD="width: 204, bgcolor: white"]ACCIDENT
[/TD]
[TD="width: 124, bgcolor: white"]accident rollover
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: transparent"]Period
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: #D9D9D9"]NUMBER
[/TD]
[TD="width: 204, bgcolor: #D9D9D9"]WORK ORDER
[/TD]
[TD="width: 124, bgcolor: #D9D9D9"]WORK ORDER DESCRIPTION
[/TD]
[/TR]
[TR]
[TD="width: 204, bgcolor: #D9D9D9"]TYPE
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25858720
[/TD]
[TD="width: 204, bgcolor: white"]BULK ISSUE
[/TD]
[TD="width: 124, bgcolor: white"]Bulk Issue Parts
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25858729
[/TD]
[TD="width: 204, bgcolor: white"]SERVICING
[/TD]
[TD="width: 124, bgcolor: white"]Bulk Oil
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791362
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791353
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791366
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791369
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791377
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791379
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791382
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25801712
[/TD]
[TD="width: 204, bgcolor: white"]ACCIDENT
[/TD]
[TD="width: 124, bgcolor: white"]ACCIDENT
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25933250
[/TD]
[TD="width: 204, bgcolor: white"]ACCIDENT
[/TD]
[TD="width: 124, bgcolor: white"]ACCIDENT
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: transparent"]Period
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: #D9D9D9"]NUMBER
[/TD]
[TD="width: 204, bgcolor: #D9D9D9"]WORK ORDER
[/TD]
[TD="width: 124, bgcolor: #D9D9D9"]WORK ORDER DESCRIPTION
[/TD]
[/TR]
[TR]
[TD="width: 204, bgcolor: #D9D9D9"]TYPE
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791353
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791366
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791369
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 503"]
<tbody>[TR]
[TD="width: 670, bgcolor: transparent"]
I want to delete the row begging with Period and also the next 2 rows with a result like below.
[TABLE="width: 314"]
<tbody>[TR]
[TD="width: 418, bgcolor: transparent, colspan: 3"]OPEN WORK REPORT
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25524484
[/TD]
[TD="width: 204, bgcolor: white"]ACCIDENT
[/TD]
[TD="width: 124, bgcolor: white"]accident rollover
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25858720
[/TD]
[TD="width: 204, bgcolor: white"]BULK ISSUE
[/TD]
[TD="width: 124, bgcolor: white"]Bulk Issue Parts
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25858729
[/TD]
[TD="width: 204, bgcolor: white"]SERVICING
[/TD]
[TD="width: 124, bgcolor: white"]Bulk Oil
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791362
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791353
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791366
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791369
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791377
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791379
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791382
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25801712
[/TD]
[TD="width: 204, bgcolor: white"]ACCIDENT
[/TD]
[TD="width: 124, bgcolor: white"]ACCIDENT
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25933250
[/TD]
[TD="width: 204, bgcolor: white"]ACCIDENT
[/TD]
[TD="width: 124, bgcolor: white"]ACCIDENT
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791353
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791366
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791369
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
</tbody>[/TABLE]
Here is the code that I have but it only deletes the row with Period in it.[/TD]
[/TR]
</tbody>[/TABLE]
Sub Delete_Rows()
Dim lRow As Long
Dim iCntr As Long
lRow = 20
For iCntr = lRow To 1 Step -1
If Cells(iCntr, 1) = "Period" Then
Rows(iCntr).Delete
End If
Next
End Sub
[TABLE="width: 314"]
<tbody>[TR]
[TD="width: 418, bgcolor: transparent, colspan: 3"]OPEN WORK REPORT
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: transparent"]Period
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: #D9D9D9"]NUMBER
[/TD]
[TD="width: 204, bgcolor: #D9D9D9"]WORK ORDER
[/TD]
[TD="width: 124, bgcolor: #D9D9D9"]DESCRIPTION
[/TD]
[/TR]
[TR]
[TD="width: 204, bgcolor: #D9D9D9"]TYPE
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25524484
[/TD]
[TD="width: 204, bgcolor: white"]ACCIDENT
[/TD]
[TD="width: 124, bgcolor: white"]accident rollover
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: transparent"]Period
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: #D9D9D9"]NUMBER
[/TD]
[TD="width: 204, bgcolor: #D9D9D9"]WORK ORDER
[/TD]
[TD="width: 124, bgcolor: #D9D9D9"]WORK ORDER DESCRIPTION
[/TD]
[/TR]
[TR]
[TD="width: 204, bgcolor: #D9D9D9"]TYPE
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25858720
[/TD]
[TD="width: 204, bgcolor: white"]BULK ISSUE
[/TD]
[TD="width: 124, bgcolor: white"]Bulk Issue Parts
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25858729
[/TD]
[TD="width: 204, bgcolor: white"]SERVICING
[/TD]
[TD="width: 124, bgcolor: white"]Bulk Oil
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791362
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791353
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791366
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791369
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791377
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791379
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791382
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25801712
[/TD]
[TD="width: 204, bgcolor: white"]ACCIDENT
[/TD]
[TD="width: 124, bgcolor: white"]ACCIDENT
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25933250
[/TD]
[TD="width: 204, bgcolor: white"]ACCIDENT
[/TD]
[TD="width: 124, bgcolor: white"]ACCIDENT
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: transparent"]Period
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: #D9D9D9"]NUMBER
[/TD]
[TD="width: 204, bgcolor: #D9D9D9"]WORK ORDER
[/TD]
[TD="width: 124, bgcolor: #D9D9D9"]WORK ORDER DESCRIPTION
[/TD]
[/TR]
[TR]
[TD="width: 204, bgcolor: #D9D9D9"]TYPE
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791353
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791366
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791369
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 503"]
<tbody>[TR]
[TD="width: 670, bgcolor: transparent"]
I want to delete the row begging with Period and also the next 2 rows with a result like below.
[TABLE="width: 314"]
<tbody>[TR]
[TD="width: 418, bgcolor: transparent, colspan: 3"]OPEN WORK REPORT
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25524484
[/TD]
[TD="width: 204, bgcolor: white"]ACCIDENT
[/TD]
[TD="width: 124, bgcolor: white"]accident rollover
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25858720
[/TD]
[TD="width: 204, bgcolor: white"]BULK ISSUE
[/TD]
[TD="width: 124, bgcolor: white"]Bulk Issue Parts
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25858729
[/TD]
[TD="width: 204, bgcolor: white"]SERVICING
[/TD]
[TD="width: 124, bgcolor: white"]Bulk Oil
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791362
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791353
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791366
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791369
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791377
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791379
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791382
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25801712
[/TD]
[TD="width: 204, bgcolor: white"]ACCIDENT
[/TD]
[TD="width: 124, bgcolor: white"]ACCIDENT
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25933250
[/TD]
[TD="width: 204, bgcolor: white"]ACCIDENT
[/TD]
[TD="width: 124, bgcolor: white"]ACCIDENT
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791353
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791366
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
[TR]
[TD="width: 90, bgcolor: white, align: right"]25791369
[/TD]
[TD="width: 204, bgcolor: white"] MAINTENANCE
[/TD]
[TD="width: 124, bgcolor: white"]PMI
[/TD]
[/TR]
</tbody>[/TABLE]
Here is the code that I have but it only deletes the row with Period in it.[/TD]
[/TR]
</tbody>[/TABLE]
Sub Delete_Rows()
Dim lRow As Long
Dim iCntr As Long
lRow = 20
For iCntr = lRow To 1 Step -1
If Cells(iCntr, 1) = "Period" Then
Rows(iCntr).Delete
End If
Next
End Sub