Skip to content

Latest commit

 

History

History
43 lines (28 loc) · 1.1 KB

Excel.ShapeRange.Fill.md

File metadata and controls

43 lines (28 loc) · 1.1 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
ShapeRange.Fill property (Excel)
vbaxl10.chm640103
vbaxl10.chm640103
Excel.ShapeRange.Fill
90cdad1e-ecc5-e5be-4270-51c28666b0f4
05/14/2019
medium

ShapeRange.Fill property (Excel)

Returns a FillFormat object for a specified shape or a ChartFillFormat object for a specified chart that contains fill formatting properties for the shape or chart. Read-only.

Syntax

expression.Fill

expression A variable that represents a ShapeRange object.

Example

This example adds a rectangle to myDocument and then sets the foreground color, background color, and gradient for the rectangle's fill.

Set myDocument = Worksheets(1) 
With myDocument.Shapes.AddShape(msoShapeRectangle, _ 
        90, 90, 90, 50).Fill 
    .ForeColor.RGB = RGB(128, 0, 0) 
    .BackColor.RGB = RGB(170, 170, 170) 
    .TwoColorGradient msoGradientHorizontal, 1 
End With

[!includeSupport and feedback]