Skip to content

Latest commit

 

History

History
49 lines (30 loc) · 1.18 KB

Excel.Workbook.Colors.md

File metadata and controls

49 lines (30 loc) · 1.18 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Workbook.Colors property (Excel)
vbaxl10.chm199088
vbaxl10.chm199088
Excel.Workbook.Colors
60fc038b-980b-c1bc-6d1c-69d9d31a11ba
05/29/2019
medium

Workbook.Colors property (Excel)

Returns or sets colors in the palette for the workbook. The palette has 56 entries, each represented by an RGB value. Read/write Variant.

Syntax

expression.Colors (Index)

expression A variable that represents a Workbook object.

Parameters

Name Required/Optional Data type Description
Index Optional Variant The color number (from 1 to 56). If this argument isn't specified, this method returns an array that contains all 56 colors in the palette.

Example

This example sets the color palette for the active workbook to be the same as the palette for Book2.xls.

ActiveWorkbook.Colors = Workbooks("BOOK2.XLS").Colors

This example sets color five in the color palette for the active workbook.

ActiveWorkbook.Colors(5) = RGB(255, 0, 0)

[!includeSupport and feedback]