Get shape by Id or Name

前端 未结 4 1492
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-11 18:55

Is there any way to get a shape if you know its Id?

For example:

Dim myshape As Shape
myshape.Id = 42
myshape = getShapeById(myshape.Id)         


        
4条回答
  •  旧时难觅i
    2020-12-11 19:18

    Not sure about by ID, but by name use the sheet Shapes collection object

    Set myShape = .Shapes("")
    

    eg

    Set myShape = ActiveSheet.Shapes("Rectangle 1")
    

提交回复
热议问题