Sorting and Column Headers

S

seven_percent

When you have a range selected and there are not values in all columns
of the top row, the default behavior of Sort will be to not include a
column header. However, I have a data range that DOES have column
headers across the range, and yet, whenever I go to sort, it does not
use the column header values. It still says "Column A, Column B,
etc" Can someone point me to the rules for this feature; i.e. when it
will pick up the headers and when it won't?
 
P

Pete_UK

You need to make the headers distinctive, eg by emboldening, or
different colours/font size etc.

You should click on Header Row in the sort dialogue if they are not
automatically picked up (if you have highlighted the range first).

Hope this helps.

Pete
 
S

seven_percent

You need to make the headers distinctive, eg by emboldening, or
different colours/font size etc.

You should click on Header Row in the sort dialogue if they are not
automatically picked up (if you have highlighted the range first).

Hope this helps.

Pete



- Show quoted text -

Thanks. Making them bold worked. However, that is the most
ridiculous functionality I have ever seen. I had already used Freeze
Panes to keep the headers from scrolling. Is that not distinctive
enough???
 
S

Shane Devenshire

Hi Daniel,

Here is the deal - you don't need to format the top row differently from the
rest of the data IF Excel can determine that the top row is a header row.
Excel first checks to see if the data type of any field's top cell is
different from the data type of the second row. For example, if A1 contains
the word "Date" and A2 contains a date such as 1/1/2009 then Excel will
assume the first row is a header row and sort accordingly. However, if cell
A1 contains the word "Name" and A2 contains a text entry such as "Shane"
Excel will assume the first row is part of the data. If you have many
columns of data only one column needs to meet the condition of being a
different data type on row 2 for Excel to assume that the top row is a
title.

If all the data is text, with text titles then you need to give Excel a hint
that the top row is a header, this is why you need to format something on
the top row differently than the data below - font style, font type, fill
color, font color, border, ...

Only one cell on the header needs to be formatted.

Cheers,
Shane Devenshire
Microsoft Excel MVP
 

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