VBA代码,让已经复制到Excel里面的所有图片 长6CM宽9CM
比如表格里面有3个大小不一的图片,我需要调成一样大小,上面图片都是截屏得到的,完整的代码,O(∩_∩)O谢谢咯纵横比已经锁定了,如何先接开...
比如表格里面有3个大小不一的图片,我需要调成一样大小,上面图片都是截屏得到的,完整的代码,O(∩_∩)O谢谢咯
纵横比已经锁定了,如何先接开 展开
纵横比已经锁定了,如何先接开 展开
3个回答
展开全部
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
老兄,这分也太少了吧
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
老兄,这分也太少了吧
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
试试下面的代码,统一活动工作表的图片为同一尺寸
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这句可以先解除锁定
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这句可以先解除锁定
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Sub 设置图片尺寸()
ActiveSheet.DrawingObjects.Select
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Height = 255# '高9厘米
Selection.ShapeRange.Width = 170.25 '宽6厘米
End Sub
追问
我的图片纵横比锁定了如何在代码前先所有先解开
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询