Name
shape
.SetShapesDefaultProperties( )
Synopsis
Makes the shape’s formatting the default formatting for all subsequent shapes. Use the PickUp
and Apply
methods to copy formatting from one shape to another. The following code draws a star, sets its fill, and then makes that formatting the default:
Sub Defaults( ) Dim ws As Worksheet, s As Shape Set ws = ActiveSheet ' Draw star Set s = ws.Shapes.AddShape(msoShape5pointStar, 50, 50, 40, 40) ' Set its fill. s.Fill.PresetGradient msoGradientDiagonalUp, 1, msoGradientChrome ' Make this the default style. s.SetShapesDefaultProperties ' Draw another star. Set s = ws.Shapes.AddShape(msoShape5pointStar, 90, 90, 40, 40) End Sub
Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.