0
嗨,我有以下代碼將數據從工作表1複製到工作表2中。所有列都已被選中,如何修改以僅選擇列A,I和M:從工作表1複製特定列到工作表2的vba代碼
Sub NewSheetData()
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
Dim Rng As Range
Set Rng = Range([A1], Range("A" & Rows.Count).End(xlUp))
On Error Resume Next
With Rng
.AutoFilter , field:=1, Criteria1:="*TC*", Operator:=xlOr
.SpecialCells(xlCellTypeVisible).EntireRow.Copy Sheets("Sheet2").Range("A1")
.AutoFilter
End With
On Error Goto 0
Application.EnableEvents = True