Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
hiding columns
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. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
hiding columns
One way would be for you to simply record the actions you take under various
project conditions and have them available for future use. Plan ahead a little so your macros don't include too many extra unneeded steps, but as long as the end result is what you want, that's ok also. Just use Tools | Macro | Record New Macro give each one a meaningful name such as "HideForTypeXProjects" and be sure and choose the [Store Macro in] option of Personal Macro Workbook. That will keep the macros on your machine so they are always available to you and won't get distributed with the .xls files you distribute. You can record all of the keystrokes necessary to set up an entire workbook at once, including selecting sheets, columns, hiding them, etc. " 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. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
hiding columns
Thanks for the information. The only problem is that you can't predict
which categories will be used on each project. |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
hiding columns
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
2 questions one on list/combo boxes and the other on "atomically" hiding columns or rows. | New Users to Excel | |||
EXCEL should let me establish unlimited numbers of columns. | Excel Discussion (Misc queries) | |||
Hiding multiple columns | Excel Discussion (Misc queries) | |||
Removing Near-Duplicate Rows, Leaving Those w/Most Data in Specific Columns | Excel Discussion (Misc queries) | |||
Hiding columns | Excel Discussion (Misc queries) |