Question : Colors in Excel are randomly changing

A user is experiencing this issue:

This may seem irrelevant in the grand scheme of things but I have to reboot several times each day because many of the Excel spreadsheets that I work in are color-coded. One minute my font may be red, then it suddenly changes to another color. Same with backgrounds/highlights. One minute it's bright yellow then it's light grey and I don't even know it's highlighted.

Any suggestions?

Answer : Colors in Excel are randomly changing

Phantange,

The problem is most probably caused by the inconsistent use of the colour palette. The colour palette can only hold a certain number of colours (56 or 64 - I can't remember, but it doesn't matter). As soon as you or someone else used a colour that is not in the standard colour palette, that new colour will be interpreted as a different colour if the user's colour palette has a different set of colours in their palette.

Although it's all very pretty to use special colours in a workbook it has it's problems and I believe you have found one of them.

The best thing is to just use the standard colour palette and stick with that. To reset your colour palette copy the code below into an ordinary VBA module thus:

 1) Press ALT+F11  
2) Find the workbook name, right-click on it  
3) Select Insert/Module  
4) Double click on the new Module  
5) Paste the code into the Module under Option Explicit  
6) ALT + F11 to return to the worksheet  
7) ALT + F8 to select and run the macro

Hope it helps

Patrick

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
Sub reset_colour_palette()
 
ActiveWorkbook.Colors = Array(0, 16777215, 255, 65280, 16711680, 65535, 16711935, _
                            16776960, 128, 32768, 8388608, 32896, 8388736, 8421376, _
                            12632256, 8421504, 16751001, 6697881, 13434879, 16777164, _
                            6684774, 8421631, 13395456, 16764108, 8388608, 16711935, _
                            65535, 16776960, 8388736, 128, 8421376, 16711680, 16763904, _
                            16777164, 13434828, 10092543, 16764057, 13408767, 16751052, _
                            10079487, 16737843, 13421619, 52377, 52479, 39423, 26367, _
                            10053222, 9868950, 6697728, 6723891, 13056, 13107, 13209, _
                            6697881, 10040115, 3355443)
End Sub
Random Solutions  
 
programming4us programming4us