Re: Hide Rows per criteria

Giganews Newsgroups
Subject: Re: Hide Rows per criteria
Posted by:  Bob Phillips (bob.N…
Date: Wed, 10 Jan 2007

    For Each cell In range("R4:R7000)
        If Application.Countif("ICG",cell.Resize(,18)) > 0 Then
            cell.EntireRow.Hidden = True
        End If
    Next cell



(change the xxxx to gmail if mailing direct)

"2D Rick" <rbrowni…> wrote in message
>I need to look thru a range "  Worksheets(1).Range("R4:AI7000")  " row
> by row and hide the row if "ICG" is not in any of the 18 cells in that
> row. Similar to what AutoFilter does only in VBA.
> "ICG" can show up once or twice per row and in any position along the
> 18 cells.
> If "ICG" is found, do nothing and check next row.
> If found hide the row.
> Once printed I would like to un-hide all rows.
> Thanks, Rick


In response to

Hide Rows per criteria posted by 2D Rick on 10 Jan 2007