I am trying to write a macro inside of Sheet 1 that will search Column J for certain terms one of them being "STEP" Once the search finds that term in Column J, I want it to copy the entire row to Sheet 2. The code I have researched and found doesnt seem to be doing it. Here is the code that I have been using:
Sub Test()
Set a = Sheets("Sheet1")
Set b = Sheets("Sheet2")
Set c = Sheets("Sheet3")
Dim x
Dim z
x = 1
z = 4
Do Until IsEmpty(a.Range("J" & z))
If a.Range("J" & z) = "STEP" Then
x = x + 1
b.Rows(x).Value = a.Rows(z).Value
Else
If a.Range("J" & z) = "SCEP" Then
x = x + 1
c.Rows(x).Value = a.Rows(z).Value
End If
End If
z = z + 1
Loop
End Sub
Bookmarks