‘Shapes 对象
‘指定的工作表上的所有 Shape 对象的集合。
‘说明
‘每个 Shape 对象都代表绘图层中的一个对象,如自选图形、任意多边形、图片、图表等。
Sub 基本的属性() Dim ob As Shape n = Sheet1.Shapes.Count For Each ob In Sheet1.Shapes k = k + 1 ob.Select Cells(k + 1, "f") = ob.Name ‘图形名称 Cells(k + 1, "g") = ob.Type ‘图形类型 Cells(k + 1, "h") = ob.Top ‘顶端坐标 Cells(k + 1, "i") = ob.Left ‘左端坐标 Cells(k + 1, "j") = ob.Width ‘宽度 Cells(k + 1, "k") = ob.Height ‘高度 Next ob End Sub Sub 图形插入() Sheet3.Shapes.AddPicture ThisWorkbook.Path & "\7pic\林志玲.png", _ True, True, 100, 100, 70, 70 End Sub Sub 图形删除() For Each shp In Sheet3.Shapes shp.Delete Next shp End Sub
时间: 2024-10-05 04:25:23