Hi Bob

find attach.

Try :

Sub Mtest()
Dim c As Range
On Error Resume Next
With ActiveSheet
For Each c In .Range("A1:A100")
If c.Interior.ColorIndex <> 6 Then c.EntireRow.Hidden = Not
c.EntireRow.Hidden
Next c
End With
On Error GoTo 0
End Sub

Thanks
Mahesh

On Sat, Aug 20, 2011 at 8:45 PM, dguillett1 <dguille...@gmail.com> wrote:

> Post your file with a complete explanation and tell us your excel version.
>
> -----Original Message----- From: Bob
> Sent: Saturday, August 20, 2011 7:46 AM
>
> To: MS EXCEL AND VBA MACROS
> Subject: $$Excel-Macros$$ Hide Rows that are NOT Yellow
>
> On Sheet2 I have some rows that are highlighted in yellow and some
> not. I'd like for when the user clicks on the command button to hide
> all the rows NOT in Yellow. And another command button to unhide. I'm
> familiar with installing the command buttons, just don't know how to
> write the code to hide and unhide. Thanks so much for any help.
>
> --
> ------------------------------**------------------------------**
> ----------------------
> Some important links for excel users:
> 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/**
> exceldailytip <http://twitter.com/exceldailytip>
> 2. Join our LinkedIN group @ 
> http://www.linkedin.com/**groups?gid=1871310<http://www.linkedin.com/groups?gid=1871310>
> 3. Excel tutorials at 
> http://www.excel-macros.**blogspot.com<http://www.excel-macros.blogspot.com>
> 4. Learn VBA Macros at 
> http://www.quickvba.blogspot.**com<http://www.quickvba.blogspot.com>
> 5. Excel Tips and Tricks at 
> http://exceldailytip.blogspot.**com<http://exceldailytip.blogspot.com>
>
> To post to this group, send email to excel-macros@googlegroups.com
>
> <><><><><><><><><><><><><><><>**<><><><><><><>
> Like our page on facebook , Just follow below link
> http://www.facebook.com/**discussexcel<http://www.facebook.com/discussexcel>
> --
> ------------------------------**------------------------------**
> ----------------------
> Some important links for excel users:
> 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/**
> exceldailytip <http://twitter.com/exceldailytip>
> 2. Join our LinkedIN group @ 
> http://www.linkedin.com/**groups?gid=1871310<http://www.linkedin.com/groups?gid=1871310>
> 3. Excel tutorials at 
> http://www.excel-macros.**blogspot.com<http://www.excel-macros.blogspot.com>
> 4. Learn VBA Macros at 
> http://www.quickvba.blogspot.**com<http://www.quickvba.blogspot.com>
> 5. Excel Tips and Tricks at 
> http://exceldailytip.blogspot.**com<http://exceldailytip.blogspot.com>
>
> To post to this group, send email to excel-macros@googlegroups.com
>
> <><><><><><><><><><><><><><><>**<><><><><><><>
> Like our page on facebook , Just follow below link
> http://www.facebook.com/**discussexcel<http://www.facebook.com/discussexcel>
>

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

Attachment: Hide Rows.xls
Description: MS-Excel spreadsheet

Reply via email to