Skip to content

Latest commit

 

History

History
53 lines (33 loc) · 1.31 KB

Excel.Shape.ZOrder.md

File metadata and controls

53 lines (33 loc) · 1.31 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Shape.ZOrder method (Excel)
vbaxl10.chm636088
vbaxl10.chm636088
Excel.Shape.ZOrder
e2eede8f-6e8f-2219-2cb2-47db93e9f90a
05/14/2019
medium

Shape.ZOrder method (Excel)

Moves the specified shape in front of or behind other shapes in the collection (that is, changes the shape's position in the z-order).

Syntax

expression.ZOrder (ZOrderCmd)

expression A variable that represents a Shape object.

Parameters

Name Required/Optional Data type Description
ZOrderCmd Required MsoZOrderCmd Specifies where to move the specified shape relative to the other shapes.

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

[!includeSupport and feedback]