hello
i try to highlight the lastrow after sum data it dosn't works perfectly and i have a problem it also highlight after col b every time run the macro it supposes highlighting the lastrow a:b and if i run the macro repeatedly it should make the rows which before last row contain no color just the lastrow every time run the macro
Sub highlight()
Dim r, ir As Long
ir = Cells(Rows.Count, 2).End(xlUp).Row
Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Select
ActiveCell.Offset(0, 0).Value = "total"
ActiveCell.Offset(0, 1).Select
ActiveCell.Formula = "=sum(b2:b" & ir & ")"
For c = 1 To ir
r = ActiveSheet.Cells(ActiveSheet.Rows.Count, c).End(xlUp).Row
Cells(r, c).Interior.ColorIndex = 4
Next
End Sub