Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a neatly formatted data table for printing (it runs across A1:ET35). Within this range are many hidden columns. I want to set it up so that a user can easily toggle visibility of columns C:DR, for which the outline functionality seems ideal. However, this toggling should keep the hidden columns hidden -- it's just the visible columns that should appear/disappear when performing the show detail/hide detail toggle (e.g. clicking on the +/- signs).

Unfortunately however, hiding detail then showing detail resets all column widths such that the hidden columns are no longer hidden.

The solution I have found to this so far is to set the hidden columns to a width of 0.1. This way they are almost still hidden, but their column width is retained when showing detail. This doesn't feel ideal, however, not least because you can still see a sliver of the hidden columns when printing. Is there a better way?

share|improve this question
Another problem with this workaround is that when using the keyboard to move between cells, the 'hidden' cells get selected. Also, I noticed that when the worksheet is protected, outlining is disabled, which I didn't want. But that's a separate issue. (The only solution I found requires the use of macros, which I'm trying to avoid.) – Michael Pavey Mar 8 '12 at 10:11

Have you thought of creating Custom Views for this task? This example is Excel 2003 but you can do the same in later versions as well. Have one displaying all columns you normally want visible, and another with them hidden.

enter image description here

You can add a toolbar showing the different available and it is a simple selection of displaying whatever layout you prefer.

enter image description here

share|improve this answer
Thanks @datatoo, that's a really interesting suggestion. I am both ashamed and intrigued to say I did not even know about custom views! However, I did a quick test by creating three views of one worksheet, equivalent to the three views available using the outlining. Trying to then apply one of the views gave me this rather unhelpful error message: "Some view settings could not be applied."! Any ideas? – Michael Pavey Mar 8 '12 at 10:10
I should probably have mentioned, I'm using Excel 2007. – Michael Pavey Mar 8 '12 at 10:17
yes I have gotten the same unhelpful message in the past and as you say, it tells you nothing much. All I can suggest is seeing if it behaves as you expect to accomplish what you need. But there may be some gotcha with the print area etc. You will just have to try it I think – datatoo Mar 8 '12 at 14:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .