Sorting Problem

siasarma

New Member
Joined
Sep 20, 2008
Messages
46
I have made a check register with the fill colors alternating between yellow and white every other one. Then I locked the sheet with the "Select Locked Cells", "Select Unlocked Cells", "Sort", "Use Autofilter", and "Edit Objects" check boxes selected. Now my problem is when I sort the list by date at the end of the month, which I always do so I can reconcile my account easier, all the fill colors will get out of order. So, I'm just wondering if there is a way that I can lock the fill colors too, so that they always stay where they are and do not sort with the list.

Thanks!
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
You could do this if you assign the colours using conditional formatting.

Select cell A1, go to Format - Conditional Formatting, set Formula is to =MOD(ROW(),2)=1 and set the format to yellow. Then use the format painter to copy the format to the whole row and to all other applicable rows. The formatting will not be affected by sorting the data.
 
Upvote 0
Cornflake Girl, I was using that formula but an MVP on this board helpfully gave me a more robust formula: =MOD(ROW()-ROW(A$2)+0,2)=0. Would this be appropriate?
 
Upvote 0
I don't think that formula would actually make any difference* in this circumstance, because we're only working mod2. In other formulas, that sort of robustness (ie making sure the formula still works if you insert / delete rows / columns) is essential.

*I'm prepared to be corrected on this!
 
Upvote 0
Ok, one more question. What if I want to copy and paste some of my entries into a different row. I have the formula you said, but if I copy something that is on the white row and paste it into the yellow row it will overwrite it and make it white...I did not put format the white rows...would that help? I tried really quick and it didn't seem to...
 
Upvote 0
You need to put the conditional formatting on all the rows, yellow and white. The formatting belongs to the row position, rather than to the data, so however you reorder the rows, if they have the formatting, they will have the right colour.
 
Upvote 0

Forum statistics

Threads
1,214,981
Messages
6,122,566
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top