I have an excel sheet with few hundred columns, and I want only about 30 of them, each has a column name, is there way by which I can select/filter columns just the way we do for the rows? I would like to do it without macros, as I have never used them before.

I am sorry if it is a very basic question, but I tried to search a lot and all I got was how to select multiple columns (ctrl+click on columns :) ) and filter columns to get specific rows.

e.g. Out of

col1 col2 col3 col4
... ... ... ... ...
... ... ... ... ...
... ... ... ... ...
... ... ... ... ...

I want only

col1 col3
... ...
... ...
... ...
... ...
link|improve this question
What do you mean "select/filter columns just the way we do for the rows"? Do you mean Data Filtering? So you want to have data filtering not with column headers, but row headers? – Richard Morgan Sep 8 '11 at 16:25
feedback

migrated from stackoverflow.com Sep 9 '11 at 3:55

This question came from our site for professional and enthusiast programmers.

2 Answers

If the columns you want to hide are the same columns every time, you might use Custom Views (View - Custom Views in Excel 2003). Create a view called "normal" with all the columns showing. Then hide the columns you want and create another view called "hidden". Now you can switch between normal and hidden views easily.

If you want to hide columns dynamically, I'm afraid you're stuck with a macro.

For more on custom views, see http://www.dailydoseofexcel.com/archives/2004/09/21/quickly-hiding-columns/

link|improve this answer
feedback

Assuming you know which column labels you need, you can use the Name box to quickly select them.

Suppose you want to select columns B, E and H. Enter B:B,E:E,H:H into the Name box, like so (they don't have to be uppercase):

enter image description here

Press Enter, and all the columns you typed will be selected:

enter image description here

You may also record the steps above into a short macro.


Named Ranges + Name Box

You can also make this a bit easier by assigning named ranges to your columns, and then using the Name box to select them when you need to. If your datasheet has unique headers, you can do this quickly:

  1. Highlight your data table.
  2. Press Ctrl + Shift + F3
  3. Check Top Row (only).

To select columns:

  1. Type their names/headers (separated by commas) into the Name box.
  2. Press Enter.

Example:

I created named ranges for the following data sheet using the method I described above. To select the Shape and Opacity columns, I just type shape,opacity into the Name box.

enter image description here

After I press Enter then Ctrl + Space (to make sure entire columns are selected), I get this:

enter image description here

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.