Share via

How to keep cell colours when sorting

Anonymous
2024-05-10T11:58:55+00:00

Hi, i want to keep cells to stay in specific color, but when i sorting this is changing, how i can permanently color the cells?

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

5 answers

Sort by: Most helpful
  1. Rich~M 20,370 Reputation points Volunteer Moderator
    2024-05-22T14:14:00+00:00

    Hi Marcin. I am an Excel user like you.

    Format your data as a Table and select any cell inside your table so that you see the Table Design tab on the ribbon. Select that tab to see the Table Design ribbon and un-check the box for Banded Rows.

    This will stop Excel from automatically coloring the alternating rows which is coloring some of the rows when the data is sorted.

    Now highlight the cells in the rows you want colored and using the Fill Color tool add the color to the rows you want colored. This color will follow the data when it is sorted.

    Original:

    Sorted:

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2024-05-22T13:33:46+00:00

    i want to get this effect, top row on grey color, first row of the table is green, second is blue, third is yellow and the last is white, but when i'm formatting this as a table, i can't choose color for one row

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2024-05-12T03:34:41+00:00

    couldn't change the color of a single

    Only highlight specifc row whatever this row in any position during the sorting,is not it?

    cli_raw_td~1;

    select '<tr '||iif(rowid=2,'style="background:pink"','')||'><td>'||f01 f01,f02 from left_join order by f02;

    select '<tr '||iif(rowid=2,'style="background:pink"','')||'><td>'||f01 f01,f02 from left_join order by f02 desc;

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2024-05-11T22:23:40+00:00

    I tried to do it this way, but I use several parameters to sort the tables and when formatting the tables, I couldn't change the color of a single row, I could only set the color in every other row

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2024-05-10T16:50:07+00:00

    Hello Marcin,

    Welcome to the Microsoft Community.

    From your description, sorry I find it hard to confirm the exact effect you want. But I will show you an example regarding to my understanding to your question. If I misunderstand your question unfortunately, feel free to point out my mistake.

    So these are our two example cell groups.

    The left ones are painted with color using the "Fill Color" tool.

    And the right ones are painted using the "Format as Table" feature.

    And now we sort these cells. Please notice that the sort rule changes from "Smallest to Largest" to "Largest to Smallest"

    As you can see, in the left group, the cell colors of the first line (where you see ENG in the prior state) changes from grey to green, because color follows its content, and the content changes from ENG to MAT.

    While in the right group, although the content changes as well, the cell color stays the same to its prior state.

    Again, please let me know if this is the effect you want? If not, you can tell me and I will try to find a more accurate understanding to your question.

    Best Regards,

    William Yu | Microsoft Community Support Specialist

    Was this answer helpful?

    0 comments No comments