|
Excel Interior Colorindex
Use the interior property to return an interior object.
Excel interior colorindex. In xl97 xl2000 vbe help alt f11 f1 index colorindex property. Excel s color palette has an index of 56 colors which can be used throughout your spreadsheet. Vba color index codes list when using vba to code the colorindex or background color of a cell it is useful to know what integer will equal what color.
Sub setclearbackgroundcolor colorindex range range a1 e20 interior colorindex 4142 end sub the above macro will set the interior colorindex to 4142 enumeration. Interior colorindex property excel 04 27 2019. Set colorindex to xlcolorindexnone to specify that you don t want an interior fill.
We have a vba function called as color index which is used to change the colors of the cells or the cell range provided this functions has unique identification for different type of colors. For example purple is a mix of blue and red. The color is specified as an index value into the current color palette or as one of the following xlcolorindex constants.
For reasons unknown aside from the index value excel also recognizes the names for colors 1 through 8 black white red green blue yellow magenta and cyan. Each of these colors in the palette is associated with a unique value in the colorindex. Using colors is easily achieved in excel vba.
Expression a variable that represents an interior object. The excel vba color on the other side allows you to set any color to any excel cell property using the vba rgb function. Place three command buttons on your worksheet and add the following code lines.
Interior colorindex 4142 is enumeration to clear the backgound or fill color. Changing background colors in excel vba is easy. The excel vba colorindex property limits you however to 56 theme or default excel colors and is rarely used in practice.
Source : pinterest.com