Info

Workbooks.OpenText Filename:= _ "C:\invoice.txt", Origin _

:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote , ConsecutiveDelimiter:=False, Tab:=True, 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 1 Find the last row with data. This might change every day FinalRow = Range("A65536").End(xlUp).Row TotalRow = FinalRow + 1 ' Build a Total row below this Range("A" & TotalRow).Value = "Total"

Range("E" & TotalRow).Resize(1, 3).FormulaR1C1 = "=SUM(R2C:R[-1]C)" Rows("1:1").Font.Bold = True

Rows(TotalRow & ":" & TotalRow).Font.Bold = True Cells.Columns.AutoFit End Sub

0 0

Post a comment