Sort without moving formatting
问题 I have an Excel table in which multiple rows are given different coloured backgrounds by VBA macros. These background colours should be locked to the rows. My problem is that when the table is sorted by one column or another the background colours move as the data is reordered. Can I format in another way to stop this happening so that the cells remain locked? The code I use to format is: For Each Row In rng.Rows If Condition Then Row.Select cIndex = ColourIndex(colour) With Selection