PDA

View Full Version : Solved: Formatting issues



Klartigue
04-19-2012, 10:51 AM
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!

Bob Phillips
04-19-2012, 03:42 PM
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

Klartigue
04-20-2012, 07:27 AM
That works great, thank you so much!