Sub ResizeShapes() Dim shp As Shape For Each shp In ActiveSheet.Shapes shp.LockAspectRatio = msoFalse If Not Intersect(shp.TopLeftCell, Range('L9:L16')) Is Nothing Then shp.Width = 87.874015748 shp.Height = 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

Excel VBA Macro: Resize and Center Shapes in Specific Cells

原文地址: http://www.cveoy.top/t/topic/mAwY 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录