View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Jason Morin Jason Morin is offline
external usenet poster
 
Posts: 63
Default Hiding row base on cell content

Sub HideGrey()

Dim cell As Range
Dim rngisect As Range

Set rngisect = Application.Intersect(ActiveSheet. _
UsedRange, Range("A:A"))

For Each cell In rngisect
If cell.Interior.ColorIndex = 15 Then 'Gray-25%
cell.EntireRow.Hidden = True
End If
Next

End Sub

---
HTH
Jason
Atlanta, GA

"brownti via OfficeKB.com" wrote:

I did a search and came up with some things, but nothing quite like i want.
I want to have a macro linked to a button that when clicked will hide all
rows that have a gray background in column A of that row. And then i will
have another button that will unhide all those rows. Thanks,

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200702/1