Development platform: Excel 2016 64 bit.xlRange.Characters(1, 2).Font.Color = 6 (equivalent to: RGB(6,0,0)).= RGB(150,0,0) (equivalent to ColorIndex 3).Where value can be created by the RGB function returned as a long whole number. Fig 5: binary AND - last 8 digits on the right.Only the last 8 digits on the right are relevant. Line 95: 16737843 And 255 returns 51, 51 \ 1 returns 51, remainder 0įurther details of the binary And are provided in figure 5.' omitted (&HFF00), the assigned value is -256 ' leading &H is the prefix radix (base) for hexadecimal R = (ColDec And &HFF) \ 256 ^ 0 ' &HFF hexadecimal = 255 decimal Includes test routineįunction xlfDec2RGB(ByVal ColDec As Long) As String The ColorConstants Auto List drop down is shown in figure 4.įig 4: VBA ColorConstants - VBA Auto List drop down with 8 itemsĬode 3 prints a list of the ColorConstants numerical values to the immediate window (figure 5).Ĭode 5: Function xlfDec2RGB converts color decimal to RGB comma separated values. The 8 colours listed in section 1.1 have name equivalents listed as members of the VBA ColorConstants class in the decimal colour system. Ten of the ColorIndex colours are duplicate pairs: BC243C True Red (Pantone) FF0033 Bright Red (Safe Hex3) 922A31 Bright Red (Resene) While the names are relatively explicit, we still can’t seriously work without their HEX values. Offset(i - 1, j - 1).Font.ColorIndex = 2 Code 2: Sub ColIndx2WSarraS procedure prints ColorIndex to WS array (7 rows by 8 columns)Ĭonst TLC As String = "B2" ' top left cell
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |