Results 1 to 2 of 2

Evaluate sumproduct function with range variable

Threaded View

walduxas Evaluate sumproduct function... 09-06-2012, 10:49 AM
walduxas Re: Evaluate sumproduct... 09-13-2012, 01:25 AM
  1. #1
    Registered User
    Join Date
    03-20-2009
    Location
    Lithuania
    MS-Off Ver
    Excel 2013
    Posts
    99

    Evaluate sumproduct function with range variable

    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?
    Last edited by walduxas; 09-13-2012 at 01:26 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1