Macro help (delete rows based on row value)

Obied70

Board Regular
Joined
Nov 4, 2015
Messages
177
Office Version
  1. 365
Platform
  1. Windows
Hi All,
I need some help from all of you geniuses. I'd like to utilize a macro to delete rows in a spreadsheet based on a repeating set of formats. In the table below, the macro would need to start deleting at the first empty row (2) and finish with deleting the last row "Date/Time Origination." If it makes it easier, the final row is always colored blue. Any help would be great, thanks!
May 18, 2018 5:02:02 PM EDT

<tbody>
</tbody>
blank

<tbody>
</tbody>
blank
Originating or Terminating CUCM End User:

<tbody>
</tbody>
Department: Sales

<tbody>
</tbody>
Outbound Calls: 22

<tbody>
</tbody>
Average Outbound Duration: 00:07:14

<tbody>
</tbody>
Total Outbound Duration: 02:39:27

<tbody>
</tbody>
blank
Call Details

<tbody>
</tbody>
Date/Time Origination

<tbody>
</tbody>

<tbody>
</tbody>
 
Last edited:
In that case could you post some more data so that I can see what is needed.
 
Upvote 0

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
the add-ins are not working on this machine for whatever reason so I can't get my worksheet posted however all i need is for the code youve already posted to repeat itself until it reaches the end of the sheet.
 
Upvote 0
You can try this, but I've no idea if it will work.
Code:
Sub DelRws()
Dim i As Long
For i = 1 To Application.CountIf(Range("A:A"), "Date/Time Origination")
   With Range("A:A")
      .Replace "Date/Time Origination", "=XXX", xlWhole, , False, , False, False
      .Rows(.SpecialCells(xlBlanks)(1).Row & ":" & .SpecialCells(xlFormulas, xlErrors)(1).Row).EntireRow.Delete
      .Replace "=XXX", "Date/Time Origination", xlWhole, , False, , False, False
   End With
Next i
End Sub
 
Upvote 0
That's a bit of luck :)

Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,215,160
Messages
6,123,355
Members
449,097
Latest member
thnirmitha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top