I've got another noodle scratcher here that Im hoping one of you amazing brains can help me with.
I've got a script that runs a bunch of functions, sets a bunch of Dim values, sorts stuff etc.
Its been running great but all of a sudden today it gets to line 774 where Im asking it to set a Dim based on a SumIf function and it throws up the error "Unable to get the SumIf property of the WorksheetFunction class" error
Weirdest part (to me anyway) is that I use almost identical lines several times earlier on in the script.
The Dim JRCount is set, used and reused several times earlier in the script. In the most recent case JRCount gets set to 76.
MC is set as a Dim in the beginning of the script and its set used, and reset to new values (also using sumif) and re-used several times before it gets to the fail point.
That all being said, the line it fails on looks something like this
MC = WorksheetFunction.Sumif(Sheets("abcde").Range("a2:a" & JRCount), "Specific text", Sheets("abcde").Range("z2:z" & JRCount))
There are numerous instances of the specific text Im asking it to look for in the range Im asking it to look in (A2:A76).
I also dont understand why this line in almost exactly the same syntax (just different sheet name that its searching on) would run fine but not when it gets to this point.
Any thoughts / help would really save the day here.
Thanks
I've got a script that runs a bunch of functions, sets a bunch of Dim values, sorts stuff etc.
Its been running great but all of a sudden today it gets to line 774 where Im asking it to set a Dim based on a SumIf function and it throws up the error "Unable to get the SumIf property of the WorksheetFunction class" error
Weirdest part (to me anyway) is that I use almost identical lines several times earlier on in the script.
The Dim JRCount is set, used and reused several times earlier in the script. In the most recent case JRCount gets set to 76.
MC is set as a Dim in the beginning of the script and its set used, and reset to new values (also using sumif) and re-used several times before it gets to the fail point.
That all being said, the line it fails on looks something like this
MC = WorksheetFunction.Sumif(Sheets("abcde").Range("a2:a" & JRCount), "Specific text", Sheets("abcde").Range("z2:z" & JRCount))
There are numerous instances of the specific text Im asking it to look for in the range Im asking it to look in (A2:A76).
I also dont understand why this line in almost exactly the same syntax (just different sheet name that its searching on) would run fine but not when it gets to this point.
Any thoughts / help would really save the day here.
Thanks