Skip to content

Latest commit

 

History

History
49 lines (35 loc) · 1.29 KB

Excel.Shape.SetShapesDefaultProperties.md

File metadata and controls

49 lines (35 loc) · 1.29 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Shape.SetShapesDefaultProperties method (Excel)
vbaxl10.chm636086
vbaxl10.chm636086
Excel.Shape.SetShapesDefaultProperties
7fee7695-99ea-5094-002a-f21f280d5541
05/14/2019
medium

Shape.SetShapesDefaultProperties method (Excel)

Makes the formatting of the specified shape the default formatting for the shape.

Syntax

expression.SetShapesDefaultProperties

expression A variable that represents a Shape object.

Example

This example adds a rectangle to myDocument, formats the rectangle's fill, sets the rectangle's formatting as the default shape formatting, and then adds another smaller rectangle to the document. The second rectangle has the same fill as the first one.

Set myDocument = Worksheets(1) 
With myDocument.Shapes 
 With .AddShape(msoShapeRectangle, 5, 5, 80, 60) 
 With .Fill 
 .ForeColor.RGB = RGB(0, 0, 255) 
 .BackColor.RGB = RGB(0, 204, 255) 
 .Patterned msoPatternHorizontalBrick 
 End With 
 ' Set formatting as default formatting 
 .SetShapesDefaultProperties 
 End With 
 ' Create new shape with default formatting 
 .AddShape msoShapeRectangle, 90, 90, 40, 30 
End With

[!includeSupport and feedback]