I Googled around and cobbled a macro to generate a random fill color. I pre-select the range I want colored, and it fills that range with the supposedly random number using the RGB naming convention. It has worked very well on most of my spreadsheets except for one. In this case I have used a variety of color fills to separate different types of information - and for fun. However, it will select a color almost every time that is somewhere used on this sheet. I may have a total of 20 or so different colors - no where near the 255 x 255 x 255 = 16 million or so possibilities. I have not seen how far it will go in repeating pre-used colors but I have had it do so 10 times in a row before i quit trying. I am not using any conditional formatting on this sheet. Here is the code: '
The lines I've "remarked out" were abortive attempts to foil the color matching gremlin. I've watched the three rand variables as they are generated one by one to see if i could possibly tell that they were being generated based on previously used rgb codes already in use - but I saw nothing unusual other than the code ended up being one that has already been used on this spreadsheet.
This is not life-threatening, but I sure am curious and willing to accept shame and remorse at overlooking something simple - if one of you can tell me what is going on. I have seen no repetitious color selecting on virgin sheets.
Thanks in advance.
Korndorb
Bookmarks