Name

shape.IncrementRotation(Increment)

Synopsis

Rotates a shape.

Argument

Settings

Increment

The number of degrees to rotate the shape

The following code draws and rotates a star:

Sub Rotate( )
    Dim ws As Worksheet, s As Shape, i As Integer
    Set ws = ActiveSheet
    ' Draw a star.
    Set s = ws.Shapes.AddShape(msoShape5pointStar, 120, 80, 40, 40)
    ' Rotate it.
    For i = 0 To 6
        Application.Wait Now + 0.00001
        s.IncrementRotation 10
    Next
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.