Dazzawm
Well-known Member
- Joined
- Jan 24, 2011
- Messages
- 3,786
- Office Version
- 365
- Platform
- Windows
This is more or less the first code I have written, but could someone point out where it is failing. I am trying to find "Front Link Rod" in column S then copy the entire row onto sheet 2 but all it does is keep copying the first row. I dont think I am far off. Thanks
Code:
Sub test()
Dim a As Integer
Dim b As Integer
Dim c As Integer
Range("S1").Select
a = ActiveCell.CurrentRegion.Rows.Count
c = 1
For b = 1 To a
If Selection.Value = "Front Link Rod" Then
Selection.EntireRow.Copy
Sheets("sheet2").Select
Cells(c, 1).Select
ActiveSheet.Paste
c = c + 1
Sheets("sheet1").Select
Else
Selection.Offset(1, 0).Select
End If
Next b
End Sub