Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Hiding changing columns

Jim
Let me outline a possible scenario and you decide if this might suit
what you want.
You trigger a macro to execute.
The code displays an Input Box and asks you to type in the day you want.
(The "day you want" is the text of the column header of the column you
want.)
You type it in and click OK.
The code does the rest.
Post back if this fits with what you want. HTH Otto
"Jim" wrote in message ...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 695
Default Hiding changing columns

put in sheets codemodule
then doubleclick anywher in sheet and type column letter to unhide

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Columns(InputBox("Column to unhide ")).Hidden = False
End Sub


"Jim" skrev:

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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Hiding changing columns

right click sheet tabview codecopy/paste thissave
now when you double click any cell in the column it will show that column
ONLY until you double click any cell in the visible column again.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If columns("iv").Hidden = True Then
columns("a:iv").EntireColumn.Hidden = False
Exit Sub
Else
columns("a:iv").EntireColumn.Hidden = True
columns(ActiveCell.Column).EntireColumn.Hidden = False
End If
End Sub

--
Don Guillett
SalesAid Software

"Jim" wrote in message ...
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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 695
Default Hiding changing columns

tye d:g
is unhiding d,e,f,g

"excelent" wrote:

put in sheets codemodule
then doubleclick anywher in sheet and type column letter to unhide

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Columns(InputBox("Column to unhide ")).Hidden = False
End Sub


"Jim" skrev:

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





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Hiding changing columns

I think that line "columns(ActiveCell.Column).EntireColumn.Hidde n = False"
is what I was looking for. Thanks!!

"Don Guillett" wrote in message
...
right click sheet tabview codecopy/paste thissave
now when you double click any cell in the column it will show that column
ONLY until you double click any cell in the visible column again.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If columns("iv").Hidden = True Then
columns("a:iv").EntireColumn.Hidden = False
Exit Sub
Else
columns("a:iv").EntireColumn.Hidden = True
columns(ActiveCell.Column).EntireColumn.Hidden = False
End If
End Sub

--
Don Guillett
SalesAid Software

"Jim" wrote in message ...
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





  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Hiding changing columns


Try the whole thing, as written.

--
Don Guillett
SalesAid Software

"Jim" wrote in message ...
I think that line "columns(ActiveCell.Column).EntireColumn.Hidde n = False"
is what I was looking for. Thanks!!

"Don Guillett" wrote in message
...
right click sheet tabview codecopy/paste thissave
now when you double click any cell in the column it will show that column
ONLY until you double click any cell in the visible column again.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If columns("iv").Hidden = True Then
columns("a:iv").EntireColumn.Hidden = False
Exit Sub
Else
columns("a:iv").EntireColumn.Hidden = True
columns(ActiveCell.Column).EntireColumn.Hidden = False
End If
End Sub

--
Don Guillett
SalesAid Software

"Jim" wrote in message ...
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







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
Hiding Columns lehigh46 Excel Worksheet Functions 2 November 28th 05 11:41 PM
comment indicator changing the color or hiding the indicators Giovanni Excel Discussion (Misc queries) 2 September 3rd 05 12:37 AM
Hiding Columns belony Excel Discussion (Misc queries) 4 June 15th 05 12:27 AM
Hiding or changing #N/A value Mac Landers Excel Worksheet Functions 9 January 28th 05 01:17 AM
Changing caption text and hiding buttons Paul_Russell[_6_] Excel Programming 2 February 5th 04 08:46 PM


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