VBA select shapes based on their positions

后端 未结 4 2335
孤城傲影
孤城傲影 2021-01-07 01:05

How do I select all shapes (array? range?) where the value in Cell \"A:Shape.TopLeftCell.Row\" = 0 ? \"ente

4条回答
  •  误落风尘
    2021-01-07 01:15

    You can loop through the shapes on the sheet until you find one in the range. As someone else mentioned, selecting is often unnecessary.

    Dim shp As shape
    For Each shp In ActiveSheet.shapes
        If Not Intersect(yourselectedrange, shp.TopLeftCell) Is Nothing Then
             shp.Select
             Exit For
        End If
    Next shp
    

提交回复
热议问题