Excel VBA 代码:自动调整 L9 到 L16 范围内图片大小
Sub ResizePictures() Dim pic As Shape For Each pic In ActiveSheet.Shapes If pic.Type = msoPicture Then If Intersect(pic.TopLeftCell, Range('L9:L16')) Is Nothing Then 'do nothing Else pic.LockAspectRatio = msoFalse 'unlock aspect ratio pic.Width = pic.Width / pic.Height * pic.TopLeftCell.Height 'resize width to match cell height pic.Height = pic.TopLeftCell.Height 'set height to match cell height End If End If Next pic End Sub
原文地址: https://www.cveoy.top/t/topic/mALX 著作权归作者所有。请勿转载和采集!