Skip to content

Latest commit

 

History

History
50 lines (34 loc) · 1.49 KB

Excel.ShapeNodes.SetPosition.md

File metadata and controls

50 lines (34 loc) · 1.49 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
ShapeNodes.SetPosition method (Excel)
vbaxl10.chm112010
vbaxl10.chm112010
Excel.ShapeNodes.SetPosition
ad76e3d9-51d2-51fd-2af1-9eee7b62e52c
05/14/2019
medium

ShapeNodes.SetPosition method (Excel)

Sets the location of the node specified by Index. Note that, depending on the editing type of the node, this method may affect the position of adjacent nodes.

Syntax

expression.SetPosition (Index, X1, Y1)

expression A variable that represents a ShapeNodes object.

Parameters

Name Required/Optional Data type Description
Index Required Long The node whose position is to be set.
X1 Required Single The position (in points) of the new node relative to the upper-left corner of the document.
Y1 Required Single The position (in points) of the new node relative to the upper-left corner of the document.

Example

This example moves node two in shape three on myDocument to the right 200 points and down 300 points. Shape three must be a freeform drawing.

Set myDocument = Worksheets(1) 
With myDocument.Shapes(3).Nodes 
 pointsArray = .Item(2).Points 
 currXvalue = pointsArray(0, 0) 
 currYvalue = pointsArray(0, 1) 
 .SetPosition 2, currXvalue + 200, currYvalue + 300 
End With

[!includeSupport and feedback]