将当前代码从整行复制到静态范围

试着调整下面的代码,将整行复制到一个静态的行(即:A:Q)

Sub CopyRows() Dim bottomL As Integer Dim x As Integer bottomL = Sheets("Pacer").Range("L" & Rows.Count).End(xlUp).Row: x = 1 Dim c As Range For Each c In Sheets("Raw Data").Range("A1:L" & bottomL) If (c.Value = "Group1" Or c.Value = "Group2" Or c.Value = "Group3") Then c.EntireRow.Copy Worksheets("Formatted Data").Range("A" & x + 1) x = x + 1 End If Next c End Sub 

可能最容易使用相交。

 intersect(c.parent.columns("A:Q"), c.EntireRow).Copy Worksheets("Formatted Data").Range("A" & x + 1)