Results 1 to 3 of 3
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hide column if summ is ZERO (2000 sr-1)

    How to hide the column in range B:AR where the sum in line 144 is zero?
    in this case hide the column C, J,M,N...AR

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Hide column if summ is ZERO (2000 sr-1)

    How about this?

    <pre>Option Explicit
    Sub HideCols()
    Dim rCell As Range
    For Each rCell In Range("B144:AR144")
    rCell.EntireColumn.Hidden = (rCell = 0)
    Next
    Set rCell = Nothing
    End Sub</pre>


  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hide column if summ is ZERO (2000 sr-1)

    perfect!
    TKS.

Posting Permissions

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