So you have a worksheet with categories laid out across the top (say row 1) and
maybe some description in column A?
You could put a couple of buttons from the Forms toolbar on the worksheet that
run macros to hide/show the columns.
I'd resize row 1 and column A to fit both buttons (so that they're always
visible).
Then assign the buttons to one of these macros:
Option Explicit
Sub HideCols()
Dim iCol As Long
Dim LastCol As Long
Application.ScreenUpdating = False
With ActiveSheet
LastCol = .Cells(1, .Columns.Count).End(xlToLeft).Column
For iCol = 2 To LastCol
If Application.Sum(.Columns(iCol)) = 0 Then
'hide the column
.Columns(iCol).Hidden = True
Else
.Columns(iCol).Hidden = False
End If
Next iCol
End With
Application.ScreenUpdating = True
End Sub
Sub ShowCols()
With ActiveSheet
.Columns.Hidden = False
End With
End Sub
If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
wrote:
I am hoping someone can help me out with this. I have set up a
spreadsheet to help manage projects around the company. There is an
input worksheet and I would like to hide columns that will not be used
in the project. For example, if the category A01 will not have any
funds applied to it, I would like to hide that column. Is there any
way to do this without having to do it manually?
If you need more information let me know and I can try to explain it
better.
--
Dave Peterson