Macro - Delete or Hide Based On Conditional Format Font Color

ValiMandy

New Member
Joined
May 10, 2016
Messages
31
Hello,

I would like a macro that runs when the sheet is activated. I would like it to delete any row that contain white font, however the font will be white because of conditional formatting. Also, I can make that work otherwise if we could complicate it more and have it only look in Columns B:J that would be even better.

Thanks, and hopefully this is possible. I'm not so great with Macros.

Mandy
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
put below in worksheet code module:
Code:
Private Sub Worksheet_Activate()

Dim cel As Range

With Me
    For Each cel In .Range("B1:J" & .UsedRange.Rows.Count)
        If cel.DisplayFormat.Font.Color = vbWhite Then cel.EntireRow.Delete
    Next
End With

End Sub
 
Upvote 0

Forum statistics

Threads
1,214,613
Messages
6,120,515
Members
448,968
Latest member
Ajax40

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