Delete NON HIGHLIGHTED rows

joyousrob

Board Regular
Joined
Nov 12, 2014
Messages
56
Hi guys.
Using conditional formating of a certain Word I have selected a colum which now has highlighted and non highlited cells.
I would like to delete all the rows, where that colum (F) is not highlighted.
Any ideas?
Thanks
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Hi guys.
Using conditional formating of a certain Word I have selected a colum which now has highlighted and non highlited cells.
I would like to delete all the rows, where that colum (F) is not highlighted.
Any ideas?
Thanks
By "highlighted" do you mean selected, or colored (say yellow), or perhaps other methods of highlighting?
 
Upvote 0
Hello Joyousrob,


If you have a mix of high-lighted (coloured) and non high-lighted cells (no fill) in Column F, then the following code will clear the non high-lighted cells ,plus the relevant entire row of data:-


Code:
Sub ClearNonHighLighted()

Application.ScreenUpdating = False

     Dim lRow As Long

lRow = Range("F" & Rows.Count).End(xlUp).Row

For Each cell In Range("F2:F" & lRow)
     If cell.Interior.ColorIndex = xlNone Then
     cell.EntireRow.ClearContents
     End If
Next

Columns("A").SpecialCells(4).EntireRow.Delete
Application.ScreenUpdating = True

End Sub

I think that this is what you may be wanting.

I have attached my sample test work book for you to peruse.

https://www.dropbox.com/s/tbptoyqvusgmazh/Clear Rows of Non High Lighted Cells.xlsm?dl=0

Cheerio,
vcoolio.
 
Upvote 0

Forum statistics

Threads
1,206,717
Messages
6,074,491
Members
446,072
Latest member
OrangeYellow

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