Hi All, I`m looking trying to code my script for Excel,
I have a Data set that looks like this
[TABLE="width: 500"]
<tbody>[TR]
[TD]Country[/TD]
[TD]City[/TD]
[TD]Dollar[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Notes[/TD]
[TD]Hello[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Country[/TD]
[TD]City[/TD]
[TD]Dollar[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Country[/TD]
[TD]City[/TD]
[TD]Dollar[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Notes[/TD]
[TD]Hello[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
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
[TABLE="width: 500"]
<tbody>[TR]
[TD]Country[/TD]
[TD]City[/TD]
[TD]Dollar[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Notes[/TD]
[TD]Hello[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Country[/TD]
[TD]City[/TD]
[TD]Dollar[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Country[/TD]
[TD]City[/TD]
[TD]Dollar[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Notes[/TD]
[TD]Hello[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
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