Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Without the "select"
Sub Hide_Zeros_Cols() Dim Rngrow As Range Dim rng1 As Range Dim I As Range Application.ScreenUpdating = False Set rng1 = Cells(6, 1) Set Rngrow = Range(rng1, Cells(rng1.Row, _ Columns.Count).End(xlToLeft)) For Each I In Rngrow If I.Value = 0 Then _ I.EntireColumn.Hidden = True Next I Application.ScreenUpdating = True End Sub Gord On Wed, 29 Oct 2008 10:21:09 -0700, Gord Dibben <gorddibbATshawDOTca wrote: Filtering won't work across columns. You would need VBA to hide columns with zeros. Sub Hide_Zeros_Cols() Dim Rngrow As Range Dim I As Range Application.ScreenUpdating = False Range("A6").Select Set Rngrow = Range(ActiveCell, Cells(ActiveCell.Row, _ Columns.Count).End(xlToLeft)) For Each I In Rngrow If I.Value = 0 Then _ I.EntireColumn.Hidden = True Next I Application.ScreenUpdating = True End Sub Gord Dibben MS Excel MVP On Wed, 29 Oct 2008 07:21:03 -0700, Neil Pearce wrote: Autofilter can hide rows. Is there a way to hide columns based on the inputs of a particular row? i.e. columns E-Z contain information to be filtered, if cells in row 6 contain either a 0 or 1, is it possible to hide the columns containing 0? Thanking-you in advance, Neil |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need VBA Code/Marcos To Hide Less than zero amounts. Not a filter | Excel Worksheet Functions | |||
Using Hide, Unhide, and auto filter - select all on a protected sh | Excel Worksheet Functions | |||
Can I automatically hide or filter a row? | Excel Worksheet Functions | |||
Help with a hide row macro (not using filter) | Excel Worksheet Functions | |||
How do I hide a worksheet in Excel and use a password to un-hide . | Excel Discussion (Misc queries) |