Interior Colorindex No Fill Vba
This example sets the interior color for cell a1 on sheet1 to cyan.
Interior colorindex no fill vba. Excels 56 colorindex colors. Set color to automatic range a1 interior colorindex xlcolorindexautomatic example 5. Have questions or feedback about office vba or this documentation.
The line below gets the color code of the color used to fill cell a1 and prints it in cell b1. Gets the color code used to fill cell a1 cells 1 2 range a1 interior color. Here is a simple vba macro that will remove any fill colors from your selected cell range.
What this vba code does. Use the interior property to return an interior object. Place three command buttons on your worksheet and add the following code lines.
Col range a1 interior colorindex excel rgb color. Sub setcolor worksheets sheet1 range a1 interior colorindex 8 cyan end sub support and feedback. The color property takes two input types.
Instead of using excel vba s colorindex property you can use the color property. The code line below sets the background color of cell a1 to light blue. Vba excel rgb property is a color property of objects commonly used for cell color or shape color.
Each of these colors in the palette is associated with a unique value in the colorindex. Changing background colors in excel vba is easy. Set colorindex to xlcolorindexnone to specify that you don t want an interior fill.