excel插入图片自动适应表格大小

来源:互联网 发布:开源windows系统 编辑:程序博客网 时间:2024/05/21 10:06

ALT + F11

2

菜单 插入-----模块

3

键入

Sub PictureFitUnit()
    Dim sh As Shape
    For Each sh In ActiveSheet.Shapes
        sh.LockAspectRatio = False
        sh.Left = sh.TopLeftCell.Left
        sh.Top = sh.TopLeftCell.Top
        sh.Width = sh.TopLeftCell.Width
        sh.Height = sh.TopLeftCell.Height
    Next sh
End Sub

4

光标在模块中,F5执行


原创粉丝点击