Filter by cell color

ndjustin20

Board Regular
Joined
May 25, 2011
Messages
69
ok...this should be simple right?!!??!! I am using the following code and it keeps throwing an 1004 obj defined error. I have used this before but now it doesn't want to work. Any ideas:
Code:
Sub FindGoodGreen()
ActiveSheet.Range("$A$1:$T$136").AutoFilter Field:=3, Criteria1:=RGB(55, 245 _
        , 64), Operator:=xlFilterCellColor
       ActiveSheet.Range("2:7").Rows.Hidden = False
End Sub
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Works for me.
Most likely it means that there are no cells in column C that have the color matching that RGB value.
 
Upvote 0
Ok sorry....I have it in a module not inside the worksheet...inside the worksheet it works but if I call it from the module it doesn't work. It also isn't filtering correctly. It crams all the rows into a few rows when it filters. Any ideas? Thank you very much for your quick feedback also :)
 
Upvote 0
Try replacing the 2 references to ActiveSheet with the actual sheet's reference Sheets("SheetName")
 
Upvote 0
It was the sheet name....in another location!!!!!!!!!!!! Almost Bald now!!!!!!!!!!!!! LOL Thank you for the information....Can you tell me why it would cram 40 rows into 3 rows though? I can't figure out why it is doing this though. There are say 40 rows with a green cell in column C and it is only showing 3. Very strange. Have you or someone else maybe ran across this before?
 
Upvote 0

Forum statistics

Threads
1,214,383
Messages
6,119,198
Members
448,874
Latest member
Lancelots

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