MercuryVBA
Board Regular
- Joined
- Nov 12, 2013
- Messages
- 56
Hello,
Would anyone be able to have me resolve the correct way to write this SUM ( IF() ) nested array function in VBA?
I've defined "EmplID" and "FinalRowSht2" correctly earlier in the code - I'm excluding that definition here just to simplify
Many Thanks!
Would anyone be able to have me resolve the correct way to write this SUM ( IF() ) nested array function in VBA?
Code:
With Application.WorksheetFunction
.Sum(.IF(Sht2.Range("O2:O" & FinalRowSht2) = EmplID, Sht2.Range("AD2:AD" & FinalRowSht2), 0))
End With
I've defined "EmplID" and "FinalRowSht2" correctly earlier in the code - I'm excluding that definition here just to simplify
Many Thanks!