Please see the attached document regarding formatting issues. Everything is explained in the document.
Thanks for the help, almost done writing this large macro that will be so useful for me!
Printable View
Please see the attached document regarding formatting issues. Everything is explained in the document.
Thanks for the help, almost done writing this large macro that will be so useful for me!
[vba]
Sub ProcessData()
Dim lastrow As Long
Dim endat As Long
Dim i As Long
With ActiveSheet
lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = lastrow To 5 Step -1
endat = i
Do While .Cells(i - 1, "C").Value = .Cells(i, "C").Value And i - 1 >= 5
i = i - 1
Loop
.Rows(endat + 1).Insert
.Cells(endat + 1, "A") = "Total Quantity:"
.Cells(endat + 1, "H").FormulaR1C1 = "=SUM(R[-1]C:R" & i & "C)"
.Rows(i).Resize(2).Insert
.Cells(i + 1, "A").Value = "Block Trade:"
Next i
End With
End Sub
[/vba]
That works great, thank you so much!