Hide Rows where cell contains value of less than 2
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Hide Rows where cell contains value of less than 2

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Location
    England
    Posts
    212
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    Have seen an earlier post that is similar to this but I can't quite get what I want, have tried this

    Columns("A:A").CellValue(<2).EntireRow.Hidden = True

    Any Ideas?

    Thanks

    Matt

  2. #2
    Guest

    Default

      
    Either one of these :-

    Sub Without_Loop()
    Application.ScreenUpdating = False
    Columns(1).Insert
    With Range([B1], [B65536].End(xlUp)).Offset(0, -1)
    .FormulaR1C1 = "=IF(RC[1]<2,1,"""")"
    On Error Resume Next
    .SpecialCells(xlCellTypeFormulas, 1).EntireRow.Hidden = True
    On Error GoTo 0
    .Delete
    End With
    End Sub


    Sub With_Loop()
    Dim rng As Range, cell As Range
    Set rng = Range([A1], [A65536].End(xlUp))
    Application.ScreenUpdating = False
    For Each cell In rng
    If cell.Value < 2 Then cell.EntireRow.Hidden = True
    Next
    End Sub

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com