View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Toppers Toppers is offline
external usenet poster
 
Posts: 4,339
Default Hiding row base on cell content

Try:

Sub HideRow()

For Each c In Range("A:A")
If c.Interior.ColorIndex = 15 Then 'Light grey
c.EntireRow.Hidden = True
End If
Next c

End Sub
Sub UnHideRow()

For Each c In Range("A:A")
If c.EntireRow.Hidden = True Then
c.EntireRow.Hidden = False
End If
Next c
End Sub

HTH


"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