如何在specialpaste之后设置形状名称?
这是我的代码。
With Sheets("sheet1")
.Shapes("testpic").Copy
.PasteSpecial Format:=xlBitmap
End With
如何设置新图片的名称,以及位置(.top,.left等)
答案 0 :(得分:3)
添加形状时,它具有最高的索引,因此:
Sub CopyShape()
Dim ws As Excel.Worksheet
Set ws = Sheets("sheet1")
With ws
.Shapes("testpic").Copy
.PasteSpecial Format:=xlBitmap
With .Shapes(.Shapes.Count)
.Name = "myName"
.Top = 100
'etc.
End With
End With
End Sub