|
发表于 2024-10-4 07:32
来自手机
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
dongdonggege 发表于 2024-10-4 00:24
感谢老师,我也看到了相似的内容,这是添加下属,删除下属。但是添加助手,把一个子节点转移到另一个节点 ...
'没有安装没安装office2003
'可帮忙测试以下移动节点代码
Sub MoveDiagramNode()
Dim dgnNode As DiagramNode
Dim shpDiagram As Shape
Dim intCount As Integer
'Add pyramid diagram to the current document
Set shpDiagram = ActiveSheet.Shapes.AddDiagram( _
Type:=msoDiagramPyramid, Left:=10, _
Top:=15, Width:=400, Height:=475)
'Add four child nodes to the pyramid diagram
Set dgnNode = shpDiagram.DiagramNode.Children.AddNode
For intCount = 1 To 3
dgnNode.AddNode
Next intCount
'Move the second node to after where the
'fourth node is currently located.
dgnNode.Diagram.Nodes(2).MoveNode _
pTargetNode:=dgnNode.Diagram.Nodes(4), _
Pos:=msoAfterLastSibling
End Sub |
|