[Solved] VBA:hiding rows

  • Try this
    Sub Macro2()
    '
    ' FIND THE END OF THE FILE
    ' SEARCH FOR ANY ENTRY, BY SEARCHING BACKWARDS BY ROWS
    '
    If WorksheetFunction.CountA(Cells) > 0 Then
    LastRow_length = Cells.Find(What:="*", after:=[A1], _
    SearchOrder:=xlByRows, _
    SearchDirection:=xlPrevious).Row
    End If
    '
    For i = 1 To LastRow_length
    If Cells(i, 1).Value = "0" Then
    Cells(i, 1).Select
    Selection.EntireRow.Hidden = True
    End If
    Next i
    End Sub

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!