i need to insert row with total and a page break under each group e.g.
http://i1012.photobucket.com/albums/af250/nsy2204/question.jpg (i cant post images so i posted the link..)
i tried the following to insert row... however it inserted rows rather than one rows....
Sub macro() Dim sh1 As Worksheet Dim i As Long, lastrow1 As LongSet sh1 = Worksheets("Sheet1")
lastrow1 = sh1.Cells.SpecialCells(xlCellTypeLastCell).Row
For i = 1 To lastrow1
If sh1.Cells(i, "A").Value = "sell" Then
sh1.Cells(i, "A").EntireRow.Insert
End If
Next i
End Sub