View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jim[_22_] Jim[_22_] is offline
external usenet poster
 
Posts: 23
Default Hiding changing columns

Hi
I have a workbook that I need to hide columns except for the day chosen.
Here is the situation.

A B C D E Oct 1 Oct 2
.................................................. ...............HA HB HC HD

There are calculations in column E & Columns HA thru HD. On any given day I
want to be able to just see Cols A-E , that days column and Cols HA-HD. That
way I can print that days sheet and hand to my supervisor. I could write a
macro for Oct 1 and place the macro "button" under Oct 1 and so on for each
day. That would Hide Cols F - GZ and unhide Col F for Oct 1. That would
allow the user to just click that days macro. But that would mean writing
over a hundred macros when all that is changing is the "unhide that days
column" line of code.

Is there any way I can just write one macro that would work for whatever
column I want to unhide. In other words if I already have the macro buttons
in place below each date, what code do I write to unhide that days column.
Can Excel recognize which column the macro button is located in. If so, I
could just use activeCell and column to unhude that column. I hope this
makes some kind of sense.

Jim