Skip to main content

Interior.ThemeColor property

Table of contents
  1. Syntax
  2. Remarks
  3. Examples

Returns or sets a Variant value, containing an XlThemeColor constant, that represents the color. Read/write Variant.

Syntax

expression.ThemeColor

expression A variable that represents an Interior object.

Remarks

Attempting to access a theme color for an object whose color is not currently themed will result in an invalid request run-time error.

Examples

The following example sets the background color of range A1:D1 to xlThemeColorDark2.

Range("A1:D1").Interior.ThemeColor = xlThemeColorDark2

Leave a comment

Your email address will not be published. Required fields are marked *

Format your code: <pre><code class="language-vba">place your code here</code></pre>