VBA代码,让已经复制到Excel里面的所有图片 长6CM宽9CM
发布网友
发布时间:2022-05-08 09:50
我来回答
共3个回答
热心网友
时间:2024-01-21 23:25
Private Sub Del_msoPicture()
Const msoPicture = 13
Dim aryGroup() As String, i As Integer
Dim Sh As Shape
For Each shp In ActiveSheet.Shapes
If shp.Type = 13 Then
ReDim Preserve aryGroup(i)
aryGroup(i) = shp.Name
i = i + 1
End If
Next shp
ActiveSheet.DrawingObjects(aryGroup).ShapeRange.LockAspectRatio = msoFalse
ActiveSheet.DrawingObjects(aryGroup).ShapeRange.Height = 95.25
ActiveSheet.DrawingObjects(aryGroup).ShapeRange.Width = 255#
End Sub
老兄,这分也太少了吧
热心网友
时间:2024-01-21 23:26
试试下面的代码,统一活动工作表的图片为同一尺寸
Height和Width的单位为磅,纵横比未锁定。
Sub pics1size()
Dim pic As Object
For Each pic In ActiveSheet.Shapes
pic.LockAspectRatio = False
pic.Height = 170
pic.Width = 155
Next pic
End Sub
pic.LockAspectRatio = False这句可以先解除锁定
热心网友
时间:2024-01-21 23:26
Sub 设置图片尺寸()
ActiveSheet.DrawingObjects.Select
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Height = 255# '高9厘米
Selection.ShapeRange.Width = 170.25 '宽6厘米
End Sub
追问我的图片纵横比锁定了如何在代码前先所有先解开