A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Sub Test() Dim rng As Range On Error Resume Next Set rng = Application.InputBox(Prompt:="Select a range", Type:=8) On Error GoTo 0 If rng Is Nothing Then Beep Exit Sub End If Set rng = Intersect(Range("A:C"), rng.EntireRow) With rng.Borders .LineStyle = xlContinuous .Weight = xlThin End With With rng.Offset(rng.Rows.Count) .Cells(1, 1).EntireRow.Insert .Cells(0, 2).Formula = "=SUM(" & rng.Columns(2).Address & ")" .Cells(0, 3).Formula = "=SUM(" & rng.Columns(3).Address & ")" End With End Sub