相关疑难解决方法(0)

Excel vba以编程方式将代码添加到工作表模块

如何将以编程方式生成的工作簿放入类似于下面的事件代码:

Private Sub Worksheet_Change(ByVal Target As Range)

    Dim nextTarget As Range

    Set nextTarget = Range(Selection.Address) 'store the next range the user selects

    Target.Columns.Select 'autofit requires columns to be selected
    Target.Columns.AutoFit

    nextTarget.Select
End Sub
Run Code Online (Sandbox Code Playgroud)

excel vba excel-vba

14
推荐指数
1
解决办法
2万
查看次数

标签 统计

excel ×1

excel-vba ×1

vba ×1