Hi ,
Am trying to used this code to be place in a range but a having an error like this :

Application-defined or object-defined error

here is my code :

[VBA]Sub OverBook_Formula()
starttime = Timer
Dim lLR As Long

Sheets("loading").Activate
ActiveSheet.Unprotect

LR = Cells(Rows.Count, "D").End(xlUp).Row


With ThisWorkbook.Sheets("loading").Range("AA53:AY" & LR)

.Formula = "=IF(OR($H53="",$R53="",$M53=""),0,IF(AA$51<$L53,0,IF(AA$51>=$L53,IF(0<($S5 3),MIN(($S53-SUM(Z53:$Z53)),$T53,SUMIF($Y$3:$Y$20,$Y53,AA$3:AA$20)))))) "




End With





End Sub[/VBA]

can i please have a guide on that.
thanks.