Excel VBA Macro: Resize and Reposition Shapes in Specific Cells
Sub ResizeShapes() Dim shp As Shape
For Each shp In ActiveSheet.Shapes
shp.LockAspectRatio = False
If shp.TopLeftCell.Row >= 9 And shp.TopLeftCell.Row <= 16 And shp.TopLeftCell.Column = 12 Then
shp.Height = 87.874015748
shp.Width = 87.874015748
shp.Left = shp.TopLeftCell.Left + (shp.TopLeftCell.Width - shp.Width) / 2
shp.Top = shp.TopLeftCell.Top + (shp.TopLeftCell.Height - shp.Height) / 2
End If
Next shp
End Sub
原文地址: http://www.cveoy.top/t/topic/mAzf 著作权归作者所有。请勿转载和采集!