Sub Test2()
'
' test 2 Macro make The form update until today
'
Dim I As Long
Dim J As Integer
Dim H As Integer
Dim CurrentD As Date
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.DisplayStatusBar = False
'Set variable CurrentD to Today´s date
CurrentD = Format(Date, "DD/MM/YYYY")
'Go to Last used date and select the next cell
Range("E2").Select
Selection.End(xlToRight).Select
ActiveCell.Offset(0, 1).Select
'Create a Loop to keep repeating until the data for Today
Do
'Fill Cell with K
ActiveCell.FormulaR1C1 = CurrentD
For I = 1 To 12
ActiveCell.Offset(1, 0).Select
'insert formula to retrieve data
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R316C7:R316C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R317C7:R317C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R318C7:R318C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R321C7:R321C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R322C7:R322C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R323C7:R323C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R326C7:R326C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R327C7:R327C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R328C7:R328C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
'Transient Subtotal needs to be added
ActiveCell.FormulaR1C1 = "=R[-3]C+R[-6]C+R[-9]C"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = "=R[-3]C+R[-6]C+R[-9]C"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = "=R[-3]C+R[-6]C+R[-9]C"
ActiveCell.Offset(1, 0).Select
'All other data needs to be retrieved
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R331C7:R331C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R332C7:R332C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R333C7:R333C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R336C7:R336C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R337C7:R337C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R338C7:R338C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R341C7:R341C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R342C7:R342C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R343C7:R343C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R346C7:R346C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R347C7:R347C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R348C7:R348C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R351C7:R351C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R352C7:R352C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R353C7:R353C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R356C7:R356C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R357C7:R357C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R358C7:R358C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R366C7:R366C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R367C7:R367C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = _
"=SUMIFS(OTB!R368C7:R368C371,OTB!R306C7:R306C371,'Monthly OTB 2019'!RC1)"
ActiveCell.Offset(1, 0).Select
Next I
'select all cells going UP
ActiveCell.Offset(-1, 0).Select
Range(ActiveCell, ActiveCell.End(xlUp)).Select
'Execute Formula´s in Selection
Selection.Calculate
'Copy Selection
Selection.Copy
Loop Until Format(ActiveCell.Value, "DD/MM/YYYY") = CurrentD
'Paste as values
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Application.DisplayStatusBar = True
MsgBox "Update Complete"
End Sub