Excel VBA Color Code List - ColorIndex, RGB Color, VB Color
Có thể bạn quan tâm
This Excel tutorial collects the VBA color code list for reference purpose, which includes ColorIndex, RGB color, VB color.
Excel ColorIndex
VBA Excel ColorIndex Property is to set color or get color for Objects like Cell color and Shape color. ColorIndex offers 56 basic colors plus the following special numbers.
ColorIndex Value | Explanation |
-4142 / xlColorIndexNone / xlNone | No fill |
-4105 / xlColorIndexAutomatic / xlAutomatic | Default color (white) |
Example 1: Set Cell A1 font color to red
Range("A1").Font.ColorIndex = 3Example 2: Set Cell A1 back color to red
Range("A1").Interior.ColorIndex = 3Example 3: Set Cell A1 border color to red
Range("A1").Borders.ColorIndex=3Example 4: Get Cell A1 ColorIndex
col = Range("A1").Interior.ColorIndexExcel RGB color
VBA Excel RGB Property is a color Property of Objects, commonly used for Cell color or Shape color.
“RGB” stands for Red Green Blue, which are known as three primary colors, which can be combined to produce other colors. For example, purple is a mix of blue and red. 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, Red = 255 means the brightness of color red is 100%.
If you try to change a color but you don’t know the color code, you can visit the websites below
http://www.ifreesite.com/color/
http://big-coronasdklua.blogspot.hk/2011/04/rgb.html
Example 1: Set Cell A1 font color to red
Range("A1").Font.Color = RGB(255, 0, 0)Example 2: Set Cell A1 back color to red
Range("A1").Interior.Color = RGB(255, 0, 0)Example 3: Set Cell A1 border color to red
Range("A1").Borders.Color = RGB(255, 0, 0)Excel VB color
The simplest way to apply color is using the VB color name, you don’t have to remember which number represents which color, the the color for your choice is very limited.
Example: Set Cell A1 font color to red
Range("A1").Font.Color = vbRedTừ khóa » Visual Basic Color Rgb
-
RGB Function (Visual Basic For Applications) - Microsoft Docs
-
RGB Function (Visual Basic For Applications) | Microsoft Docs
-
VBA RGB | Set Color Of Interior Cell Using RGB Function
-
RGB Colours - Excel At Finance
-
Excel VBA: ColorIndex Codes List & RGB Colors
-
RGB Function - VB & VBA In A Nutshell: The Language [Book]
-
Using The RGB Function - Event Procedures - Visual Basic Planet
-
VB6 RGB Color: Chart, Codes
-
How To Enter RGB Code For Set Color On Form In VB NET 2012
-
VBA RGB | Change Color Of Background Cell Using RGB In VBA Excel
-
Create Color From R G B Values - VB.Net Tutorial
-
VBA Course: Colors - Excel
-
Excel VBA Color Code List - ColorIndex, RGB Color, VB Color - Pinterest