Results 1 to 10 of 10

Thread: Hide Rows Where Column A = Zero

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Site Admin
    The Princess
    VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location

    Hide Rows Where Column A = Zero

    But NOT where Column A is blank!

    Option Explicit
    Sub HideRowsWithZeros()
    Dim ws As Worksheet
    Dim c As Range
    Dim rngRange As Range
    Application.ScreenUpdating = False
    For Each ws In ActiveWorkbook.Worksheets
        ws.Select
        Set rngRange = Range(Cells(1, 1), Cells(65336, 1).End(xlUp))
        For Each c In rngRange
            If c.Value = 0 Then
                c.EntireRow.Hidden = True 
            End If
        Next c
    Next ws
    Application.ScreenUpdating = True
    End Sub
    And is this the best way to do it?
    Last edited by Aussiebear; 04-29-2023 at 07:00 PM. Reason: Adjusted the code tags
    ~Anne Troy

Posting Permissions

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