excel中,利用宏vbscript 插入图片 自动调整间距适应图片大小

Sub insertImg()
'
' 宏3 宏
'

'
    Dim i As Integer
    For i = 15 To 87
        Rows(i & ":" & i).RowHeight = 159.75
        imgUrl = Range("D" & i).Value

        Range("E" & i).Select
        ActiveSheet.Pictures.Insert( _
            imgUrl _
            ).Select
        ActiveWindow.SmallScroll Down:=1
        Selection.ShapeRange.ScaleWidth 0.7563636745, msoFalse, msoScaleFromTopLeft
        Selection.ShapeRange.ScaleHeight 0.7563636745, msoFalse, msoScaleFromTopLeft
    
    Next
    
    
    
    
    

   

End Sub

 

posted @ 2021-06-02 17:31  iDEAAM  阅读(488)  评论(0编辑  收藏  举报