Sub ResizeShapes() Dim shp As Shape For Each shp In ActiveSheet.Shapes shp.LockAspectRatio = False If shp.Top >= Range('L9').Top And shp.Top <= Range('L16').Top And _ shp.Left >= Range('L9').Left And shp.Left <= Range('L16').Left Then shp.Width = 87.874015748 shp.Height = 87.874015748 shp.Top = Range('L9').Top + (Range('L16').Top - Range('L9').Top - shp.Height) / 2 shp.Left = Range('L9').Left + (Range('L16').Left - Range('L9').Left - shp.Width) / 2 End If Next shp End Sub

Excel VBA Macro: Resize and Reposition Shapes within Specific Cells

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

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