这是我的代码。它运作良好,我只有一个问题。它从Sheet1复制所有行(A-D列)。最后一列(D)包含条件字符串,我不想复制/粘贴该列。 谢谢
Sub CopyInfo()
Application.ScreenUpdating = False
With ActiveSheet
.AutoFilterMode = False
With Sheet1.Range("A3:C1000", Range("D" & Rows.Count).End(xlUp))
.AutoFilter 4, "Applicable"
On Error Resume Next
.Offset(1).Copy Sheet2.Range("A" & Rows.Count).End(xlUp).Offset(1)
End With
.AutoFilterMode = False
End With
Application.ScreenUpdating = True
Sheet2.Select
End Sub
答案 0 :(得分:0)
这只会复制前三列:
.Offset(1).Resize(,3).Copy Sheet2.Range("A" & Rows.Count).End(xlUp).Offset(1)