George J
Well-known Member
- Joined
- Feb 15, 2002
- Messages
- 959
I am struggling with this - i think my text string is correct and when copying it to a cell to test, works okay, but I get error 2015 in VBA. I can't use sumif as the numbers are entered as text on the workbook.
This is the code I have which returns #value on the workbook. When entering the text to be evaluated as a formula however: =SumProduct(($D$2:$F$2083="my text")*($G$2:$G$2083))
It seems to work fine, so not sure why an error is coming up.
Can anyone point me in the right direction?
thanks.
Code:
prop.Offset(0, 2).Value = Application.Evaluate("=SumProduct((" & _
Range(myUsedRange.Offset(0, 3), myUsedRange.Offset(0, 5)).Address & "=" _
& Chr(34) & prop.Value & Chr(34) & ")*(" & myUsedRange.Offset(0, 6).Address & "))")
It seems to work fine, so not sure why an error is coming up.
Can anyone point me in the right direction?
thanks.