你能帮我解决下面的问题吗?我有一个代码,它可以在某个位置打开Excel文件,并在其中进行筛选,但在此之后,我不能选择我需要的范围:
Private Sub CommandButton1_Click()
'dim Wb as string
'dim Newdata as string
Newdata = "M:\Finance\REPORTING\2022_08\Hóközi FC\GL.xlsx"
Set Wb = Workbooks.Open(Newdata)
ThisWorkbook.RefreshAll
ActiveSheet.Range("A:AE").AutoFilter Field:=30, Criteria1:="P2"
Windows("GL.xlsx").Activate
Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
End Sub
先谢了
1条答案
按热度按时间e0uiprwp1#
复制过滤范围