marshy3300
Board Regular
- Joined
- Aug 17, 2014
- Messages
- 59
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))"
'"=IF(K2>500,"""",IF(E2=E1,IF(SUMIF($E$1:$E1,E2,$N$1:$N1)+K2<0,M2,0),M2))"
.Value = .Value
End With
End With
And getting the runtime error on the vlookup line. Not sure why. if I change it to the >500 as below that it runs fine but i want it to lookup another sheet and grab that value.
Any help would be appreciated.
THANKS!
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))"
'"=IF(K2>500,"""",IF(E2=E1,IF(SUMIF($E$1:$E1,E2,$N$1:$N1)+K2<0,M2,0),M2))"
.Value = .Value
End With
End With
And getting the runtime error on the vlookup line. Not sure why. if I change it to the >500 as below that it runs fine but i want it to lookup another sheet and grab that value.
Any help would be appreciated.
THANKS!