Howdy,
I have this code
With Sheets("CDG Current")
LastRow = .Cells(.Rows.Count, "C").End(xlUp).Row
With .Range("N2:N" & LastRow)
.Formula = _
"=IF(K2>VLOOKUP(RC4,'CDG MinMax'!R2C1:R6666C23,5,0),"""",IF(E2=E1,IF(SUMIF($E$1:$E1,E2,$N$1:$N1)+K2<0,M2,0),M2))"...