Hi All, I`m looking trying to code my script for Excel,
I have a Data set that looks like this
<tbody>
</tbody>
What I want to do is go through all my data. If I find something called Notes Cut this and the field next to it(hello) and paste it at the end of Dollar amount from the previous line.
I have a Data set that looks like this
Country | City | Dollar | |||
Notes | Hello | ||||
Country | City | Dollar | |||
Country | City | Dollar | |||
Notes | Hello |
<tbody>
</tbody>
What I want to do is go through all my data. If I find something called Notes Cut this and the field next to it(hello) and paste it at the end of Dollar amount from the previous line.
Code:
Sub test1()
Dim rcnt As Long
rcnt = Worksheets("Feuil1").Range("C" & Rows.Count).End(xlUp).Row
For i = 1 To rcnt
If Range("C" & i).Value = "Notes" Then
Range("C" & i, "D" & i).Cut
Range("M" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial
End If
Next i
Application.CutCopyMode = False
End Sub