Sub
GAForm()
Rows(1).ClearContents
With
Cells(3, 2).CurrentRegion
With
.Offset(-1, 0).Resize(.Rows.Count + 2)
.Cells(1, 1).Value = 1
.Cells(1, 1).Copy
.SpecialCells(xlCellTypeConstants, 2).PasteSpecial xlPasteValues, operation:=xlMultiply
.Rows(1).Value = Array(
"Datum"
,
"Code"
,
"Wert"
)
.Columns(1).NumberFormat =
"DD.MM.YYYY hh:mm"
.Cells(.Rows.Count, 1).Value =
"Summe"
.Cells(.Rows.Count, 3).FormulaR1C1 =
"=Sum(R[-"
& .Rows.Count - 2 &
"]C:R[-1]C)"
.BorderAround Weight:=xlThin
.Borders(xlInsideHorizontal).Weight = xlThin
.Borders(xlInsideVertical).Weight = xlThin
.Rows(1).Font.Bold =
True
.Rows(.Rows.Count).Font.Bold =
True
.Cut Destination:=Cells(5, 1)
Columns(
"A:A"
).EntireColumn.AutoFit
ActiveWindow.DisplayGridlines =
False
Columns(
"B:B"
).EntireColumn.AutoFit
Range(
"C6"
).
Select
Range(Selection, Selection.
End
(xlDown)).
Select
Range(Selection, Selection.
End
(xlDown)).
Select
Selection.NumberFormat =
"#,##0.00 $"
Rows(
"4:4"
).
Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
End
With
End
With
End
Sub