VBA复制粘贴自动筛选后的内容

来源:互联网 发布:斯凯网络 编辑:程序博客网 时间:2024/04/27 06:04

VBA复制粘贴自动筛选后的内容:

Sub sx()    If Dir("D:\VBA\xx.xls") <> "" Then        Workbooks.Open Filename:="D:\VBA\xx.xls"    Else        GoTo ERR    End If    Range("A1").Select    With Selection                  .AutoFilter Field:=1, Criteria1:=0                  .SpecialCells(xlCellTypeVisible).Copy Sheets("Temp").Range("A1")    End With    ERR: MsgBox "发现非法数据存在,程序终止!", 16End Sub


原创粉丝点击