#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,203
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default hiding columns

Thanks for the information. The only problem is that you can't predict
which categories will be used on each project.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default 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
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
2 questions one on list/combo boxes and the other on "atomically" hiding columns or rows. Marc New Users to Excel 1 March 4th 06 05:13 AM
EXCEL should let me establish unlimited numbers of columns. DAISY Excel Discussion (Misc queries) 8 February 15th 06 04:35 PM
Hiding multiple columns MDavis Excel Discussion (Misc queries) 1 July 25th 05 08:46 PM
Removing Near-Duplicate Rows, Leaving Those w/Most Data in Specific Columns foofoo Excel Discussion (Misc queries) 1 April 2nd 05 12:02 AM
Hiding columns Adam Excel Discussion (Misc queries) 2 March 31st 05 05:07 PM


All times are GMT +1. The time now is 12:21 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"