Thanks to Rick Rothstein MVP for sharing a LinkedIn article he wrote a while back about colour constants. He gave me permission to share the contents in this post. Making your own colour constants.
Rick compiled a list of over a hundred colours and gave them constant names. Here is a link to his original post. This is an article on LinkedIn, so you may need to log-in to read it.
https://www.linkedin.com/pulse/color-constants-use-vba-code-rick-rothstein
I have copied the code he provided to the file that you can download at the bottom of the post.
The screen shot below shows some of the colours C9 column C) and their variable name plus their colour number. I did a test of just using the number in Column D.
You may not need all the colours, but you can cherry pick the ones that appeal to you to use in your applications.
You can place the code at the top of your VBA module. This is in the companion file – download link below.
You can then use the constant variables in the VBA code underneath.
Hmm! I wonder if my monitor is not tuned correctly color-wise back when I first set this list up… or perhaps my old monitor was off when these were first setup, but **now** the vbAliceBlue looks orange on my current monitor and the vbBrown looks a little to reddish so the brown is lost. The other examples look alright though. Just checking… do those two colors look correct on your monitor?
Hi Rick – the Alice Blue is Orange on my screen too. I might delete that one. The other look reasonable.
Just updated.