ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Auto Hide Columns & Rows (https://www.excelbanter.com/excel-discussion-misc-queries/19229-auto-hide-columns-rows.html)

appeng

Auto Hide Columns & Rows
 
How can I hide 1 or more columns based on a cells value
For example,
If there is an X in cell A1, column F will be hidden.
If there is an X in cell A2, column F will be visible.

If there is an X in cell A3, column G will be hidden.
If there is an X in cell A4, column G will be visible.

This could be triggered by a macro.

I am using Autofilter for rows

I am using Excel 97.

Art

Dave O

Are the values in A1 and A2 mutually exclusive? That is to say, if A1
= x then A2 does not ever = x? Same question for A3 and A4. If
they're not mutually exclusive and you run a macro then the macro will
unhide and hide columns while it's running, leaving you with
inconclusive results.

Do you need to consider just A1:A4, or does the information continue
down to additional rows?


appeng

I was hoping either A1 or A2 have an x but not both.
The same for A3 and A4.

I have approximatly 10 columns that I want to hide or un-hide.

I was thinking of having associate text in B1 that may say hide column F
If A1 has an x it means hide column F
And associated text in B2 that may say un-hide column F
If A2 has an x it means un-hide column F

Another thought was to have radio buttons



"Dave O" wrote:

Are the values in A1 and A2 mutually exclusive? That is to say, if A1
= x then A2 does not ever = x? Same question for A3 and A4. If
they're not mutually exclusive and you run a macro then the macro will
unhide and hide columns while it's running, leaving you with
inconclusive results.

Do you need to consider just A1:A4, or does the information continue
down to additional rows?




All times are GMT +1. The time now is 01:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com