Francois084
New Member
- Joined
- Jun 23, 2022
- Messages
- 10
- Office Version
- 2019
- Platform
- Windows
Good day, All
I am using this code to look for specific Like value in a column then copy it over to next sheet and then remove the row
but when it goes to copy the next row it skips a row and start but the row below
Please Help.
Much thanks in advance
Sub SearchString()
Dim c As Range
Dim Source As Worksheet
Dim Target As Worksheet
Dim Target1 As Worksheet
Dim rowIterator As Long
Set Source = ActiveWorkbook.Worksheets("Master List")
Set Target = ActiveWorkbook.Worksheets("Group")
For Each c In Source.Range("E1:E" & Source.Cells(Rows.Count, "E").End(xlUp).Row)
If c Like "*FOR*" Then
c.EntireRow.copy
Target.Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial xlPasteValues
c.EntireRow.Delete
ElseIf c Like "*+*" Then
c.EntireRow.copy
Target.Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial xlPasteValues
c.EntireRow.Delete
End If
Next c
End Sub
I am using this code to look for specific Like value in a column then copy it over to next sheet and then remove the row
but when it goes to copy the next row it skips a row and start but the row below
Please Help.
Much thanks in advance
Sub SearchString()
Dim c As Range
Dim Source As Worksheet
Dim Target As Worksheet
Dim Target1 As Worksheet
Dim rowIterator As Long
Set Source = ActiveWorkbook.Worksheets("Master List")
Set Target = ActiveWorkbook.Worksheets("Group")
For Each c In Source.Range("E1:E" & Source.Cells(Rows.Count, "E").End(xlUp).Row)
If c Like "*FOR*" Then
c.EntireRow.copy
Target.Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial xlPasteValues
c.EntireRow.Delete
ElseIf c Like "*+*" Then
c.EntireRow.copy
Target.Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial xlPasteValues
c.EntireRow.Delete
End If
Next c
End Sub