Sub FormatInvoice3()
' FormatInvoice2 Macro
' Third Try. Use Relative. Don't touch Autosum
'
' Keyboard Shortcut: Ctrl+Shift+K
ChDir _
"C:\Users\Redirection\gmccray\Documents\Personal\ExcelPractice\VBAAndMacros2010"
Workbooks.OpenText Filename:= _
"C:\Users\Redirection\gmccray\Documents\Personal\ExcelPractice\VBAAndMacros2010\invoice3.txt" _
, Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=False _
, Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 3), _
Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1)), _
TrailingMinusNumbers:=True
' Turned on relative reference recording here
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "Total"
ActiveCell.Offset(0, 4).Range("A1").Select
' Don't use AutoSum. Type this formula:
Selection.FormulaR1C1 = "=SUM(R2C:R[-1]C)"
Selection.AutoFill Destination:=Range("E:G"), Type:=xlFillDefault
ActiveCell.Range("A1:C1").Select
' Turned off relative recording here
ActiveCell.Rows("1:1").EntireRow.Select
ActiveCell.Activate
Selection.Font.Bold = True
Cells.Select
Selection.Columns.AutoFit
Range("A1").Select
End Sub