A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Display columns or rows based on values



 
 
Thread Tools Display Modes
  #1  
Old March 20th, 2010, 03:38 AM posted to microsoft.public.excel.misc
bmac
external usenet poster
 
Posts: 66
Default Display columns or rows based on values

I am familiar with the custom views feature in Excel 2007. Is there a way to
cause rows or columns to automatically be hidden or displayed based on values
in row 1 or column A? For example, is there a way to select a custom view and
show only those columns where row 1 = "show this column" as opposed to
selecting each column and hiding it and then saving as a custom view. I have
a spreadsheet with many columns and likely, many custom views and I am
looking for a way to automate this.

Thanks in advance,
bmac
  #2  
Old March 20th, 2010, 02:56 PM posted to microsoft.public.excel.misc
Bob Umlas, Excel MVP
external usenet poster
 
Posts: 275
Default Display columns or rows based on values

It would be a lot easier if I knew that the columns to NOT show were blank.
If that's the case, you can either have a macro do this or manually (pretty
easy).
Manually (and you can record this in your personal.xlsm to playback) select
row 1, use Goto/Special, select Blanks, then press ctrl-0.
After a little cleanup, the 1-line macro is:

Rows(1).SpecialCells(xlCellTypeBlanks).EntireColum n.Hidden = True

HTH
Bob Umlas
Excel MVP

"bmac" wrote:

I am familiar with the custom views feature in Excel 2007. Is there a way to
cause rows or columns to automatically be hidden or displayed based on values
in row 1 or column A? For example, is there a way to select a custom view and
show only those columns where row 1 = "show this column" as opposed to
selecting each column and hiding it and then saving as a custom view. I have
a spreadsheet with many columns and likely, many custom views and I am
looking for a way to automate this.

Thanks in advance,
bmac

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:40 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.