Sub mySecondMacro() Dim lastRow As Long Dim lastRowTotal As Long Range("A1").Select ActiveCell.FormulaR1C1 = "Item" Range("B1").Select ActiveCell.FormulaR1C1 = "Price" Range("C1").Select ActiveCell.FormulaR1C1 = "Quantity" Range("D1").Select ActiveCell.FormulaR1C1 = "Total" Rows("1:1").Select With Selection.Font .Bold = True .Italic = True .Underline = xlUnderlineStyleSingle .Name = "Bookman Old Style" .Size = 12 .Color = -16776961 End With With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = False End With Range("D2").Select ActiveCell.FormulaR1C1 = "=RC[-2]*RC[-1]" Range("A1").Select lastRow = Selection.End(xlDown).Row Range("D2").Select Selection.AutoFill Destination:=Range(("D2:D") & lastRow) lastRowTotal = lastRow + 1 Range(("D") & lastRowTotal) = "=SUM(D2:D" & lastRow & ")" Range("A1:D1").Select With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlThin End With Range(("A1:D") & lastRow).Select With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlMedium End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .Weight = xlMedium End With With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .Weight = xlMedium End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .Weight = xlMedium End With Range(("D") & lastRowTotal).Select With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlMedium End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .Weight = xlMedium End With With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .Weight = xlMedium End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .Weight = xlMedium End With Range("B:B,D:D").Select Selection.Style = "Comma" Cells.Select Cells.EntireColumn.AutoFit End Sub