ZOrder Method

Microsoft Excel Visual Basic

expression.ZOrder(ZOrderCmd)

expression    Required. An expression that returns one of the objects in the Applies To list.

ZOrderCmd   Required MsoZOrderCmd. Specifies where to move the specified shape relative to the other shapes.

MsoZOrderCmd can be one of these MsoZOrderCmd constants.
msoBringForward
msoBringInFrontOfText. Used only in Microsoft Word.
msoBringToFront
msoSendBackward
msoSendBehindText. Used only in Microsoft Word.
msoSendToBack

Remarks

Use the ZOrderPosition property to determine a shape's current position in the z-order.

Example

This example adds an oval to myDocument and then places the oval second from the back in the z-order if there is at least one other shape on the document.

Set myDocument = Worksheets(1)
With myDocument.Shapes.AddShape(msoShapeOval, 100, 100, 100, 300)
    While .ZOrderPosition > 2
        .ZOrder msoSendBackward
    Wend
End With