Colorindex is used to color the background of Excel Cells
Cells(1, 2).Interior.ColorIndex = 30
etc
Here is the entire list of colors you can use:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimswqtVUihLVLg1zfQmLAgNsKryNhBMXZ15o9snZ5FLvk8yDHwI4N8FXlzOz84F2p7Ui-jMoRMXvjcofkZfBa3VfhrZMgNSLpjdQbEyDMVxWmLEPM1ecz6seS2vg_esut8IIfV/s400/ColorIndex.gif)
RSS Feeds Submission Directory
Welcome to VBA Tips & Tricks. All VBA related information will be posted on this blog. Of late, VBA has been disregarded by many software professionals for .Net, c# and other technologies. This blog will also post articles related to them too Happy reading
the ColorIndex property can be applied to other objects (eg Font, Border, Borders, FormatColor, Tab). right?
ReplyDeleteYes.
DeleteThanks but what is the code for blank (not white)?
ReplyDelete'pretty sure it's -4142
ReplyDeleteJust try it or do like me: record a new macro in Excel, and change the color of a cell or character, stop the macro and look at the result with Alt-F11 in Modules
blank (not white) equals -4142 (or xlColorIndexNone)
ReplyDeleteyou nutcase why would you need a code for no fill? time waster!!!!
ReplyDeleteIf you have already colored a sheet or cell and you want to blank it. Nutcase...
Delete