+ Reply to Thread
Results 1 to 2 of 2

Sumproduct from another sheet

  1. #1
    Registered User
    Join Date
    04-26-2016
    Location
    Minneapolis
    MS-Off Ver
    2013
    Posts
    21

    Sumproduct from another sheet

    I have the file attached, but not sure if I did it correctly

    I have a set of ID numbers on the 'Ouput' tab, and on the 'Data' tab; the same IDs exist but some are broken out or there are multiples of the same ID with different amounts. I am trying to sumproduct the IDs on the Data tab.

    the error I am getting is Runtime error '91' Object variable or with block variable not set


    Thanks so much

    Sub Test_xFill_L_v2()


    Dim LR As Long, _
    Area1 As Range, _
    Area2 As Range, _
    Area3 As Range
    Dim r As Range, c As Range, a As Range, d As Range
    Dim LastRow As Integer

    LastRow = Worksheets("Output").Cells(Rows.Count, 1).End(xlUp).Row

    Set d = Worksheets("Output").Range("L3" & LastRow)



    For Each c In d.Cells

    'ER = Sheets("Output").Range("A" & Rows.Count).End(xlUp).Row
    LR = Sheets("Data").Range("A" & Rows.Count).End(xlUp).Row
    Set Area1 = Range("A3:A" & LR)
    Set Area2 = Range("X3:X" & LR)
    'Set Area3 = Range("C2:C" & LR)

    Sheets("Output").Range("L3").Formula = "=SUMPRODUCT(--(" & Area1.Address & "=$A3)," & Area2.Address & ")"

    Next c

    For Each a In r.Areas
    With Sheets("Output").Range(a.Address)
    .Value = .Value
    End With
    Next a











    End Sub


    I have also posted this question at the link below, due to not being able to easily include an attachment I have also posted on this forum.

    http://www.mrexcel.com/forum/excel-q...ent-sheet.html
    Attached Files Attached Files
    Last edited by bsquad; 12-02-2016 at 03:50 PM.

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Sumproduct from another sheet

    Crosspost
    http://www.mrexcel.com/forum/excel-q...ent-sheet.html
    read the forum 's rules
    - Battle without fear gives no glory - Just try

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Sumproduct with Sheet as variable
    By zechy in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-20-2016, 06:54 AM
  2. sumproduct from different Sheet by looking between Date Range
    By z-eighty2 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-02-2013, 04:22 AM
  3. Replies: 15
    Last Post: 01-03-2012, 02:39 PM
  4. Sumproduct Sheet Reference
    By matthews311 in forum Excel General
    Replies: 1
    Last Post: 08-27-2010, 01:40 PM
  5. sumproduct with reference to sheet not returning value
    By lallo.jr in forum Excel General
    Replies: 5
    Last Post: 05-15-2010, 02:30 PM
  6. [SOLVED] countif more than one sheet/tab and sumproduct
    By BSantos in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-23-2006, 02:25 PM
  7. [SOLVED] Sumproduct sheet reference
    By MHoffmeier in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-19-2005, 01:06 PM

Tags for this Thread

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