VBA Excel Color Codes
On December 15,2022 by Tom RoutleyDo you want to find all of the VBA Excel Color Codes? This brief tutorial explains the different color codes for VBA Excel.
VBA Excel Color Codes
The image below list the color codes:
A sample workbook with the codes written down can be downloaded from this link: httpsjoinom/c/DIqlTjoC61G
The Conversion Function
This function allows you to convert VBA colour codes from 1 to 56 (Interior.ColorIndex) to their long value (Interior.Color):
Function CouversionCouleurLong(Couleur As Integer) As Long Dim CouleursLng() CouleursLng = 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, 16777215) 'En cas d'erreur colorie en noir If Couleur < 0 Or Couleur > 56 Then CouversionCouleurLong = 0 CouversionCouleurLong = CouleursLng(Couleur) End Function
Article Recommendations
Latest articles
Popular Articles
Archives
- November 2024
- October 2024
- September 2024
- August 2024
- July 2024
- June 2024
- May 2024
- April 2024
- March 2024
- February 2024
- January 2024
- December 2023
- November 2023
- October 2023
- September 2023
- August 2023
- July 2023
- June 2023
- May 2023
- April 2023
- March 2023
- February 2023
- January 2023
- December 2022
- November 2022
- October 2022
- September 2022
- August 2022
- July 2022
- June 2022
- May 2022
- April 2022
- March 2022
- February 2022
- January 2022
- December 2021
- November 2021
- October 2021
- September 2021
- August 2021
- July 2021
- January 2021
Leave a Reply