Hiding rows or columns based on cell contents

B

Bill H

I am looking for a solution to hide row or columns in a worksheet based upon
a value in a cell of another worksheet.

To be more specific, I have a "setup" worksheet, with a column if entires.
I have a second worksheet, "checklist" that I would like to format according
to the entries in "setup".

If setup:A1 is empty, I want to hide columns checklist 1-3
If setup:A2 is empty, I want to hide columns checklist 4-6.

ANy ideas how to set this up automatically ?
 
J

JLatham

Without resorting to a macro (VBA code) to actually hide/unhide the columns,
your best bet is probably going to be to use conditional formatting in the
checklists so that when a cell on the setup worksheet is empty (="") then the
font changes to the same color as the cell's background color.
 
B

Bill H

Jlatham,

I did try that approach, however when I had columns in the middle of the
"checklist" I wanted hidden, I ended up with blank regions.

Is a macro difficult to create ?

Bill H
 
J

JLatham

I should add to that, especially since you can't use conditional formatting
to 'test' a cell on a different worksheet. What you'd first need to do is
set up a cell on the checklist sheet linked to the cell on the setup sheet,
then set your conditional formatting to test that linked cell's value and
'hide'/'unhide' the text based on the results of the test. Note that when a
cell is linked to one that is empty, it shows up as a zero.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top