Code:
Sub test()
Dim LLRR as Long
LLRR = Range("A" & Rows.Count).End(xlUp).Row
Range("B2:B" & LLRR).Formula = "=IF(RC[-1]<>"""",SUMIF(Sheet2!C2,MySheet!RC1,Sheet2!C21),"""")"
End Sub
Code:
With Application
.Calculation = xlCalculationManual
.ScreenUpdating = False
.DisplayAlerts = False
End With