Wednesday, June 13, 2007

ColorIndex - Coloring Excel Sheet Cells

Highlight Color in Excel Cells

Colorindex is used to color the background of Excel Cells

Cells(1, 2).Interior.ColorIndex = 30


Here is the entire list of colors you can use:

RSS Feeds Submission Directory


  1. the ColorIndex property can be applied to other objects (eg Font, Border, Borders, FormatColor, Tab). right?

  2. Anonymous12:38 AM

    Thanks but what is the code for blank (not white)?

  3. Anonymous8:31 AM

    'pretty sure it's -4142
    Just 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

  4. Anonymous2:05 PM

    blank (not white) equals -4142 (or xlColorIndexNone)

  5. Anonymous5:05 AM

    you nutcase why would you need a code for no fill? time waster!!!!

    1. Anonymous2:02 AM

      If you have already colored a sheet or cell and you want to blank it. Nutcase...


Share on Facebook
Related Posts Plugin for WordPress, Blogger...

Visual Basic for Applications (VBA) Forum (recent threads)

CodeKeep VBA Feed

Visual Studio Tools for Office Forum (recent threads)

Download Windows Live Toolbar and personalize your Web experience! Add custom buttons to get the information you care about most.

Office Business Applications (OBA) Team Blog

MSDN Code Gallery Published Resources For Tag VSTO Google Group