#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 109
Default Filter/Hide

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Filter/Hide

There is no native way in Excel to hide columns based on some value,
so you would need a macro to do this for you.

Pete

On Oct 29, 2:21*pm, 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 *


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Filter/Hide

Maybe you'd settle on grouping the columns--but this is a manual effort to apply
and to use.

In xl2003 menus:
Select the columns
Data|Group and Outline|Group


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


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Filter/Hide

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


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Filter/Hide

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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need VBA Code/Marcos To Hide Less than zero amounts. Not a filter ABA Excel Worksheet Functions 1 May 14th 08 07:32 PM
Using Hide, Unhide, and auto filter - select all on a protected sh Pattie Excel Worksheet Functions 1 July 7th 06 04:47 PM
Can I automatically hide or filter a row? RJQMAN Excel Worksheet Functions 6 July 7th 05 03:49 PM
Help with a hide row macro (not using filter) [email protected] Excel Worksheet Functions 10 May 19th 05 01:36 PM
How do I hide a worksheet in Excel and use a password to un-hide . Dchung Excel Discussion (Misc queries) 3 December 2nd 04 06:24 AM


All times are GMT +1. The time now is 10:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"