我需要补偿要复制的数据,因此新数据不会擦除旧数据。
我尝试了不同的偏移量方法。但我显然做错了事
Dim lastrow As Long: lastrow = Cells(Rows.Count, "A").End(xlUp).Row
Dim lastrow2 As Long: lastrow = Cells(Rows.Count, "h").End(xlUp).Row
Application.ScreenUpdating = False
With Sheets("Test")
.AutoFilterMode = False
.Range("A1:C" & lastrow).AutoFilter field:=3, Criteria1:="=TEST Sheet", Operator:=xlFilterValues
.Range("A1:C" & lastrow).AutoFilter field:=2, Criteria1:="=New"
.Range("A2:A" & lastrow).SpecialCells(xlCellTypeVisible).Copy .Range("H26").Offset(lastrow2, 0)
.AutoFilterMode = False
End With
Application.ScreenUpdating = True
因此,基本上所有复制的数据都进入到行H,但是列表应该不断变大。