Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Can I automatically hide a column with zero values in Excel

I have a large spreadsheet which will be populated based on the selection
from a drop down list box. The values populated will contain alot of zero
values which I have blanked out using the tools/options functionality but I
would like to automatically hide the column if all values within a range in
that column are zero. Can this be done using advanced filter ? if so how ...
any other suggestions ?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default Can I automatically hide a column with zero values in Excel

I use the following Macro in a Workbook of mine.
Before running the Macro (Which is in a Standard Code module)
Click and sellect the Column-Header (First to Last) of your data;
Allows for say Column C thru Column S (Columns A & B Blank)

Try this on a COPY of your WB first

Sub HideColumnsWithZeroValues()
Dim i As Integer
Dim ColCount As Integer
Application.ScreenUpdating = False
StrCol = Selection(1).Column
ColCount = Selection.Columns.Count + StrCol - 1
With Selection
For i = StrCol To ColCount
If Application.WorksheetFunction.Sum(Columns(i)) = 0 Then
Columns(i).EntireColumn.Hidden = True
End If
Next i
End With
Application.ScreenUpdating = True
End Sub

Good Luck

"David Hainsworth" wrote:

I have a large spreadsheet which will be populated based on the selection
from a drop down list box. The values populated will contain alot of zero
values which I have blanked out using the tools/options functionality but I
would like to automatically hide the column if all values within a range in
that column are zero. Can this be done using advanced filter ? if so how ...
any other suggestions ?

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
Automatically hide column or row if a cell value meets criteria [email protected] Excel Worksheet Functions 3 June 10th 08 10:18 PM
Automatically highlight max and min values in a column in Excel Mahurshi Akilla Excel Discussion (Misc queries) 2 September 4th 07 05:19 AM
How do I set up Excel to automatically hide certain rows? Martin Excel Discussion (Misc queries) 3 December 13th 06 08:07 PM
values are appearing automatically in the next column psdonline Excel Discussion (Misc queries) 0 July 12th 06 10:40 PM
how do i set up a column with negative values automatically? pooperdoodle Excel Discussion (Misc queries) 3 August 15th 05 09:23 PM


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

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

About Us

"It's about Microsoft Excel"