Macro to make Border formatting stay with a cell after sorting


Posted by Chris Rock on November 30, 2001 8:29 PM

When a cell has border formatting and is sorted, the border formatting does not move with the values.

For example:
Column A
1 Packages
2 Boxes
3 Bags - Imagine "bags" in A3 has a border around the cell.
Go to Data - sort and sort ascending. "Bags" moves to A1 . . . but the border formatting stays in A3.

Is there any way to get the border formatting to move with the data when sorted? (Other types of formatting do move with the data - font color, background color, etc.)



Posted by Johnny on November 30, 2001 8:46 PM

One solution could be to highlight Column A
Then go to Format – Conditional Formatting
In there have Cell Value is – equal to – then next column =”Bags”
Now go to Format… – Border…Choose Outline and you have your border
Now you can sort the A column and the border will follow the bags.

Good luck

Johnny