Thank you very much for your reply and great help!
I have tried multiple ways to fit this code to my data, but I failed to do so.
Could you please help me with this?
Columns: AJ, AV, AW, AX, AY, AZ, BA, BB, BC, BD (There are few hidden columns, but I believe this doesn't really matter)
Thanks!
AJ AV AW AX AY AZ BA
[TABLE="width: 1437"]
<colgroup><col><col><col><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Model(Editable)[/TD]
[TD]Amount Per Unit(Editable)[/TD]
[TD]Expected QTY(Editable)[/TD]
[TD]Expected Cost(Editable)[/TD]
[TD]Apply Month(Editable) [/TD]
[TD]Effective Date(From)(Editable)[/TD]
[TD]Effective Date(To)(Editable)[/TD]
[TD]SPGM Tool Use
Flag[/TD]
[TD]Requestor[/TD]
[TD]Quantity[/TD]
[/TR]
[TR]
[TD]WM3370HWA.ABWEPUS[/TD]
[TD]107.[/TD]
[TD]0.[/TD]
[TD]4.[/TD]
[TD]201506[/TD]
[TD] [/TD]
[TD] [/TD]
[TD]US-NTSO-20150624-0088[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]WM3370HWA.ABWEPUS[/TD]
[TD]107.[/TD]
[TD]3.[/TD]
[TD]321.[/TD]
[TD]201507[/TD]
[TD] [/TD]
[TD] [/TD]
[TD]US-NTSO-20150624-0088[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]WM3370HWA.ABWEPUS[/TD]
[TD]107.[/TD]
[TD]0.[/TD]
[TD]38.[/TD]
[TD]201507[/TD]
[TD] [/TD]
[TD] [/TD]
[TD]US-NTSO-20150624-0088[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]WM4270HWA.ABWEPUS[/TD]
[TD]142.[/TD]
[TD]12.[/TD]
[TD]1,693.[/TD]
[TD]201506[/TD]
[TD] [/TD]
[TD] [/TD]
[TD]US-NTSO-20150624-0088[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]WM4270HWA.ABWEPUS[/TD]
[TD]142.[/TD]
[TD]90.[/TD]
[TD]12,721.[/TD]
[TD]201507[/TD]
[TD] [/TD]
[TD] [/TD]
[TD]US-NTSO-20150624-0088[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]WM8000HWA.ABWEEUS[/TD]
[TD]232.[/TD]
[TD]5.[/TD]
[TD]1,147.[/TD]
[TD]201506[/TD]
[TD] [/TD]
[TD] [/TD]
[TD]US-NTSO-20150624-0088[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]WM8000HWA.ABWEEUS[/TD]
[TD]232.[/TD]
[TD]37.[/TD]
[TD]8,584.[/TD]
[TD]201507[/TD]
[TD] [/TD]
[TD] [/TD]
[TD]US-NTSO-20150624-0088[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]WM8000HWA.ABWEEUS[/TD]
[TD]232.[/TD]
[TD]0.[/TD]
[TD]29.[/TD]
[TD]201507[/TD]
[TD] [/TD]
[TD] [/TD]
[TD]US-NTSO-20150624-0088[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]WT5680HVA.ASSEPUS[/TD]
[TD]151.[/TD]
[TD]12.[/TD]
[TD]1,800.[/TD]
[TD]201506[/TD]
[TD] [/TD]
[TD] [/TD]
[TD]US-NTSO-20150624-0088[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]WT5680HVA.ASSEPUS[/TD]
[TD]151.[/TD]
[TD]90.[/TD]
[TD]13,519.[/TD]
[TD]201507[/TD]
[TD] [/TD]
[TD] [/TD]
[TD]US-NTSO-20150624-0088[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]DLEX4270W.ABWEEUS[/TD]
[TD]142.[/TD]
[TD]7.[/TD]
[TD]987.[/TD]
[TD]201506[/TD]
[TD] [/TD]
[TD] [/TD]
[TD]US-NTSO-20150624-0088[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]DLEX4270W.ABWEEUS[/TD]
[TD]142.[/TD]
[TD]52.[/TD]
[TD]7,384.[/TD]
[TD]201507[/TD]
[TD] [/TD]
[TD] [/TD]
[TD]US-NTSO-20150624-0088[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]DLEX4270W.ABWEEUS[/TD]
[TD]142.[/TD]
[TD]0.[/TD]
[TD]33.[/TD]
[TD]201507[/TD]
[TD] [/TD]
[TD] [/TD]
[TD]US-NTSO-20150624-0088[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
</tbody>[/TABLE]
I don't know what you mean by a "dynamic macro", or how that differs from a "regular macro", but you might consider the following...
Code:
Sub FirstValue()
Dim LastRow As Long
Dim i As Long
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
Range("A1").Offset(0, 1).EntireColumn.Insert
Range("A1").Value = "Model"
Range("A1").Offset(0, 1).Value = "Expected Cost"
''''' TextToColumns to separate expected cost from model
Range("A2:A" & LastRow).Select
Application.CutCopyMode = False
Selection.TextToColumns Destination:=Range("A2"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=True, Other:=False, FieldInfo _
:=Array(Array(1, 1), Array(2, 1)), TrailingMinusNumbers:=True
''''' Delete all but the first of each model
For i = LastRow To 2 Step -1
If Cells(i, 1) = Cells(i - 1, 1) Then Cells(i, 1).EntireRow.Delete
Next i
End Sub
If your data isn't in Column A you'll have to make the adjustments.
Cheers,
tonyyy