Sub UnlockAspectRatio()

Dim sh As Shape

For Each sh In ActiveSheet.Shapes sh.LockAspectRatio = False If sh.TopLeftCell.Address = "$L$9" Or sh.TopLeftCell.Address = "$L$10" Or sh.TopLeftCell.Address = "$L$11" Or sh.TopLeftCell.Address = "$L$12" Or sh.TopLeftCell.Address = "$L$13" Or sh.TopLeftCell.Address = "$L$14" Or sh.TopLeftCell.Address = "$L$15" Or sh.TopLeftCell.Address = "$L$16" Then sh.Height = 87.874015748 sh.Width = 87.874015748 sh.Top = sh.TopLeftCell.Top + (sh.TopLeftCell.Height - sh.Height) / 2 sh.Left = sh.TopLeftCell.Left + (sh.TopLeftCell.Width - sh.Width) / 2 End If Next sh

End Sub

This VBA code loops through all shapes on the active worksheet and unlocks their aspect ratio It then sets the height and width of each shape to 87874015748 units and centers the shape within its corr

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

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