Macro to delete complete rows with multiple criterias

nccool2104

New Member
Joined
Jul 7, 2014
Messages
3
Hi All,
i have been through the web in search of a solution to my problem but i have been able to get only part of it.
I need to remove specific rows (1) in my excel sheet and rename the headers (2).
Here is the original sheet:


-- removed inline image ---


I need to remove Customer Service and System User and rename the Headers as such:

-- removed inline image ---



I found a macro but it removes only one row at a time:
Sub DeleteJunk()
Dim cell As Range, RangeToDelete As Range
For Each cell In Range(("A1"), Range("A65536").End(xlUp))
If Left(cell, 15) = "Company Pty Ltd" Then
If RangeToDelete Is Nothing Then
Set RangeToDelete = Range(cell, cell.Offset(6, 0)).EntireRow
Else
Set RangeToDelete = Application.Union(RangeToDelete, Range(cell, cell.Offset(6, 0)).EntireRow)
End If
End If
Next
On Error Resume Next
RangeToDelete.EntireRow.Delete
End Sub

Please help
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Forum statistics

Threads
1,221,418
Messages
6,159,791
Members
451,589
Latest member
Harold14

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