Category Archives: Color

No Thumbnail

Excel VBA, Row Fill Color

The following line changes the fill color of the first row to blue: Rows(1).Interior.Color = vbBlue Same as the previous line but instead of using the blue color constant it uses the blue color code Rows(1).Interior.Color = 16711680 For more information about working with colors in

No Thumbnail

Excel VBA, Sheet (All Cells) Fill Color

The following line changes the fill color of all the cells in sheet 2 to blue: Sheet2.Cells.Interior.Color = vbBlue Same as the previous line but instead of using the blue color constant it uses the blue color code Sheet2.Cells.Interior.Color = 16711680 For more information about working with

No Thumbnail

Excel VBA, ColorConstants

The class ColorConstants contains a list of color codes. Although this list is very limited but often it is enough to get the job done. If you require more specific colors please see Excel VBA, Color Code. In the example below the color code associated

vba color change fill example blue

Excel VBA, Cell Fill Color

In this article I will explain how you can set and get the fill color of cells using VBA. There are many times you may need to set the background colors of certain cells based upon a condition. Using conditional formatting is not always feasible as

No Thumbnail

Excel VBA, XlRgbColor

The enum XlRgbColor contains a list of color codes. Although this list is limited but often it is enough to get the job done. If you require more specific colors please see Excel VBA, Color Code. In the example below the color code associated with some of

No Thumbnail

Excel VBA, Color Dialog xlDialogEditColor

The xlDialogEditColor is a dialog used to get a color code from the user. Color codes are used to specify colors in VBA for Excel. For more information about working with colors please see Excel VBA Colors. Jump To: Syntax Examples Example 2, Set Fill Color You can

No Thumbnail

Excel VBA, Row Gradient Color

In the article Excel VBA, Gradient’s Colors I’ve explained the basics about working with gradient’s color. I’m assuming the reader is familiar with the topics covered in that article. – Gradient Color, Row: In the article Excel VBA, Gradient’s Colors I provided 2 examples for creating gradients with different colors. The examples

No Thumbnail

Excel VBA, Get Color Code

This article provides a sample for getting the desired color code. The user selects a fill color for the cell A1. After pressing the Get Code button the color code used will be printed in cell B1. It can be seen from the figures below that

No Thumbnail

Excel VBA, RGB

As previously mentioned in the article Excel VBA, Color Code when working with colors in Excel you must know their color code. Though sometimes you may want set the color by using the RGB color model. This can be achieved using the RGB() function. For more information

No Thumbnail

Excel VBA Range Gradient Color

In the article Excel VBA, Gradient’s Colors I’ve explained the basics about working with gradient colors. I’m assuming readers are familiar with the concepts explained in that article before reading this article. Jump To: Gradient Color, Range Modify Existing Gradients Color for Range – Gradient Color, Range: