I found two problems that I fixed.
Sub combinerows()
LastRow = Range("A" & Rows.Count).End(xlUp).Row
Set sortRange = Rows("1:" & LastRow)
sortRange.Sort _
key1:=Range("A1"), _
order1:=xlAscending, _
key2:=Range("B1"), _
order2:=xlAscending, _
Header:=xlNo
RowCount = 1
Do While Range("A" & RowCount) <> ""
If Range("A" & RowCount) = Range("A" & (RowCount + 1)) And _
Range("B" & RowCount) = Range("B" & (RowCount + 1)) Then
Range("C" & RowCount) = Range("C" & RowCount) + _
Range("C" & (RowCount + 1))
Rows(RowCount + 1).Delete
Else
RowCount = RowCount + 1
End If
Loop
Columns("A").Insert
RowCount = 1
StartRow = RowCount
Do While Range("B" & RowCount) <> ""
If Range("B" & RowCount) <> Range("B" & (RowCount + 1)) Then
Range("A" & RowCount) = "Total"
Rows(RowCount + 1).Insert
Range("A" & (RowCount + 1)) = Range("B" & RowCount) & _
" Total"
Range("D" & (RowCount + 1)).Formula = _
"=Sum(D" & StartRow & "

" & RowCount & ")"
RowCount = RowCount + 2
StartRow = RowCount
Else
If Range("B" & (RowCount + 1)) <> "" Then
Range("A" & RowCount) = "Total"
End If
RowCount = RowCount + 1
End If
Loop
End Sub