Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default macro to hide/unhide columns

I need to hide and unhide columns in a spreadsheet. My problem is that
different sets of columns are being hidden depending on the data I need. I
can create a basic macro, but can't seem to get it to work when I select more
than one column (either a range or non consecutive sets [i.e. columns C and E
or C,D, and F, etc]).

Any suggestions?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default macro to hide/unhide columns

I have an addin that does this. Would you like me to email it to you?

Charles Chickering
xl Geek

Monique wrote:
I need to hide and unhide columns in a spreadsheet. My problem is that
different sets of columns are being hidden depending on the data I need. I
can create a basic macro, but can't seem to get it to work when I select more
than one column (either a range or non consecutive sets [i.e. columns C and E
or C,D, and F, etc]).

Any suggestions?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default macro to hide/unhide columns

For Each col In Selection.Columns
col.Hidden = True
Next col

will hide them, but how will you select hidden columns?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Monique" wrote in message
...
I need to hide and unhide columns in a spreadsheet. My problem is that
different sets of columns are being hidden depending on the data I need.

I
can create a basic macro, but can't seem to get it to work when I select

more
than one column (either a range or non consecutive sets [i.e. columns C

and E
or C,D, and F, etc]).

Any suggestions?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default macro to hide/unhide columns

My thought was that I could select all the columns in my spreadsheet and run
the macro to unhide columns. This should unhide all columns. This is what I
need anyway, because I would need to select a new set of columns to hide for
the next step in my process.

Can or should I turn your macro statement into an if/then statement?

"Bob Phillips" wrote:

For Each col In Selection.Columns
col.Hidden = True
Next col

will hide them, but how will you select hidden columns?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Monique" wrote in message
...
I need to hide and unhide columns in a spreadsheet. My problem is that
different sets of columns are being hidden depending on the data I need.

I
can create a basic macro, but can't seem to get it to work when I select

more
than one column (either a range or non consecutive sets [i.e. columns C

and E
or C,D, and F, etc]).

Any suggestions?




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default macro to hide/unhide columns

Once all columns are selected press Ctrl+Shift+) to unhide all columns.

Charles Chickering
xl Geek

Monique wrote:
My thought was that I could select all the columns in my spreadsheet and run
the macro to unhide columns. This should unhide all columns. This is what I
need anyway, because I would need to select a new set of columns to hide for
the next step in my process.

Can or should I turn your macro statement into an if/then statement?

"Bob Phillips" wrote:

For Each col In Selection.Columns
col.Hidden = True
Next col

will hide them, but how will you select hidden columns?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Monique" wrote in message
...
I need to hide and unhide columns in a spreadsheet. My problem is that
different sets of columns are being hidden depending on the data I need.

I
can create a basic macro, but can't seem to get it to work when I select

more
than one column (either a range or non consecutive sets [i.e. columns C

and E
or C,D, and F, etc]).

Any suggestions?







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default macro to hide/unhide columns

PERFECT!!!!!
Thanks to both of you for the help.

"Die_Another_Day" wrote:

Once all columns are selected press Ctrl+Shift+) to unhide all columns.

Charles Chickering
xl Geek

Monique wrote:
My thought was that I could select all the columns in my spreadsheet and run
the macro to unhide columns. This should unhide all columns. This is what I
need anyway, because I would need to select a new set of columns to hide for
the next step in my process.

Can or should I turn your macro statement into an if/then statement?

"Bob Phillips" wrote:

For Each col In Selection.Columns
col.Hidden = True
Next col

will hide them, but how will you select hidden columns?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Monique" wrote in message
...
I need to hide and unhide columns in a spreadsheet. My problem is that
different sets of columns are being hidden depending on the data I need.
I
can create a basic macro, but can't seem to get it to work when I select
more
than one column (either a range or non consecutive sets [i.e. columns C
and E
or C,D, and F, etc]).

Any suggestions?





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
Auto Hide-Unhide Columns with a macro Ed Excel Discussion (Misc queries) 0 March 8th 07 07:57 PM
Auto Hide-Unhide Columns with a macro Jim Thomlinson Excel Discussion (Misc queries) 1 March 8th 07 07:04 PM
Hide/Unhide columns using button on top over relevant columns [email protected] Excel Discussion (Misc queries) 1 March 7th 07 09:24 PM
How do I hide or unhide zero value columns/rows USING A MACRO? paul Excel Discussion (Misc queries) 1 January 23rd 06 03:06 PM
Macro to hide or unhide columns Chance224 Excel Programming 1 February 14th 05 09:34 PM


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