My code can identify a row of information but I would like to add this information to a new sheet. The problem is the rows that are captured on the old worksheet keeping overwriting itself on the new sheet. How can I not overwrite the same row? Thanks in advance! Here is the code:
Code:
Sub Am()
Dim r, r2 As Long
Dim numRows As Integer
Dim myRange, twoMyRange As Range
Dim numR, twoNumR As Integer
Dim target As Long
Sheets.Add
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "AM"
Worksheets("Test").Activate
Set myRange = ActiveSheet.Range("A1:A65000")
numR = Application.CountA(myRange)
For r = 2 To numR + 1
If Mid(Cells(r + 1, 2), 19, 2) = "AM" Then
Rows(r).Select
Selection.Copy
Worksheets("AM").Activate
Set twoMyRange = ActiveSheet.Range("A1:A65000")
twoNumR = Application.CountA(twoMyRange)
For r2 = 1 To twoNumR + 1
ActiveSheet.Paste
Next r2
Worksheets("Test").Activate
End If
Next r
End Sub