I have two lines of code which are looking at the same dataset to pull in value found in col(P) based on the SUMIFS criteria. The top line is working correctly, as it's pulling in only the sum from "486". However the second line is ignoring ""<>&486"". This seems very straightforward, but for sum reason it is pulling in everything, meaning '0002337486' and every other acct number in data set. I've tried it without the & (ie. ""<>486"", and still no luck. Still learning VBA, so possibly there is something I'm doing wrong due to ignorance. Any help from one of you guys would be extremely appreciated.
Code:
.Cells(srow + 7, scol + 1) = "=SUMIFS('" & wsn & "'!$P$2:$P$1048576, '" & wsn & "'!$M$2:$M$1048576,Summary!$B$1,'" & wsn & "'!$N$2:$N$1048576,"">="" & '" & ws1n & "'!C$" & srow & ",'" & wsn & "'!$N$2:$N$1048576,""<=""&EOMONTH('" & ws1n & "'!C$" & srow & ",0),'" & wsn & "'!$B$2:$B$1048576,""486"")"
.Cells(srow + 8, scol + 1) = "=SUMIFS('" & wsn & "'!$P$2:$P$1048576, '" & wsn & "'!$M$2:$M$1048576,Summary!$B$1,'" & wsn & "'!$N$2:$N$1048576,"">="" & '" & ws1n & "'!C$" & srow & ",'" & wsn & "'!$N$2:$N$1048576,""<=""&EOMONTH('" & ws1n & "'!C$" & srow & ",0),'" & wsn & "'!$B$2:$B$1048576,""<>&486"")"