Delete Entire Row if the color yellow is in Column E

zone709

Well-known Member
Joined
Mar 1, 2016
Messages
2,125
Office Version
  1. 365
Platform
  1. Windows
Hi Not sure how to do this for color. I think yellow color is 65535 but if its not or it doesn't matter? Trying to use a macro for this.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
How about
Code:
Sub Macro2()
   Range("E:E").AutoFilter 1, RGB(255, 255, 0), xlFilterCellColor
   ActiveSheet.AutoFilter.Range.Offset(1).EntireRow.Delete
   ActiveSheet.AutoFilterMode = False
End Sub
 
Upvote 0
Thanks i think o got it working right. I changed the offset from 1 to 0. because the first cell wouldnt delete the row if yellow
 
Upvote 0
I had assumed that you had a header row that you wanted to keep.
If you change the offset to 0 then the first row will be deleted regardless of colour.
 
Upvote 0
ok good i understand thanks. My first row doesnt have a header.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,242
Members
452,623
Latest member
russelllowellpercy

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