In RGB Property, you need to give a value (from 0 to 255) for each color in order to mix a new color. For example, purple is a mix of blue and red.
“RGB” stands for Red Green Blue, which are known as three primary colors, which can be combined to produce other colors. VBA Excel RGB Property is a color Property of Objects, commonly used for Cell color or Shape color. 4105 / xlColorIndexAutomatic / xlAutomaticĮxample 1: Set Cell A1 font color to red Range('A1').Font.ColorIndex = 3Įxample 2: Set Cell A1 back color to red Range('A1').Interior.ColorIndex = 3Įxample 3: Set Cell A1 border color to red Range('A1').Borders.ColorIndex=3Įxample 4: Get Cell A1 ColorIndex col = Range('A1').Interior.ColorIndex Excel RGB color ColorIndex offers 56 basic colors plus the following special numbers.
VBA Excel ColorIndex Property is to set color or get color for Objects like Cell color and Shape color. This Excel tutorial collects the VBA color code list for reference purpose, which includes ColorIndex, RGB color, VB color.