Hi,
I have recently started to use Evaluate function so I'm not quite familiar with how it works. I managed to get this code working:
Kr = """" & Cr & """"
Kr2 = """" & Cr2 & """"
Sum = Application.Evaluate("=SUMPRODUCT((Aug12!L2:L20=" & Kr & ")*(Aug12!M2:M20=" & Kr2 & ")*(Aug12!AS2:AS20))")
However, I'd like to change range address text in this function and use additional variables instead of them. It could look something like this, but I can't managed to get it working:
Kr = """" & Cr & """"
Kr2 = """" & Cr2 & """"
CheckCrNr = 12
CheckCrNr2 = 13
SumCrNr = 45
With ThisWorkbook.Worksheets("Aug12")
Sum = Application.Evaluate("=SUMPRODUCT((" & .Columns(CheckCrNr) & "=" & Kr & ")*(" & .Columns(CheckCrNr2) & "=" & Kr2 & ")*(" & .Columns(SumCrNr) & "))")
End With
Do you have any ideas?
Bookmarks