+ Reply to Thread
Results 1 to 7 of 7

Deleting/Adding rows from source data outputs "#REF" error in the consolidated table

  1. #1
    Registered User
    Join Date
    02-03-2020
    Location
    s
    MS-Off Ver
    MS.2010
    Posts
    7

    Deleting/Adding rows from source data outputs "#REF" error in the consolidated table

    I have a sheet of recipes that contain ingredients and ingredients repeat for each recipe. After consolidating the data into another sheet, it combines duplicates and updates if I update numbers in source which is good. But if I want to add/remove a recipe which occurs very frequently, I would need to re-consolidate the whole table again or else I'll get a #Ref error in the ingredient I deleted. And an added ingredient doesn't add to the consolidated list. So I think the solution would be to create a vba that automatically consolidates everything into the summary sheet. I have searched multiple forums and many tutorial videos as my knowledge is very limited in vba. And the only success I've had is a code that consolidated the data but did not combine duplicates. I have attached the file I used but for simplicity I cut about 90% of the actual list. Any help regarding this is appreciated, maybe there is an alternative solution that doesnt require vba, I read something about the use of aggregate instead of sum, but couldnt figure that out.

    cross-posted to vbaexpress but cant add link since new profile
    Attached Files Attached Files
    Last edited by Dadashvespek; 02-05-2020 at 03:34 AM. Reason: adding crosspost

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Deleting/Adding rows from source data outputs "#REF" error in the consolidated table

    How did you arrive at the data in Sheet3? Was that manually typed in, linked to the Source sheet and then grouped? Instead of doing that, you can create a Pivot Table from the Source data.

    When data is added or removed in the Source sheet, you only need to refresh the pivot table.

  3. #3
    Registered User
    Join Date
    02-03-2020
    Location
    s
    MS-Off Ver
    MS.2010
    Posts
    7

    Re: Deleting/Adding rows from source data outputs "#REF" error in the consolidated table

    I used "consolidate data"

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Deleting/Adding rows from source data outputs "#REF" error in the consolidated table

    Create an Excel Table from your data with Insert > Table. Then create a pivot table with Insert > Pivot table. That will make your life a lot easier.

  5. #5
    Registered User
    Join Date
    02-03-2020
    Location
    s
    MS-Off Ver
    MS.2010
    Posts
    7

    Re: Deleting/Adding rows from source data outputs "#REF" error in the consolidated table

    I tried that, but the table doesnt update as I change the ingredients

  6. #6
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Deleting/Adding rows from source data outputs "#REF" error in the consolidated table

    - did you refresh the pivot table? Data will not refresh until you hit that button
    - does the pivot table source data range contain all the data? Turn your source data into an Excel table to ensure that. If you don't use an Excel table, the process of automatically including new data is a lot more complex.

  7. #7
    Registered User
    Join Date
    02-03-2020
    Location
    s
    MS-Off Ver
    MS.2010
    Posts
    7

    Re: Deleting/Adding rows from source data outputs "#REF" error in the consolidated table

    Yeah, that works for me now! Thank you teylyn!

+ 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. Replies: 7
    Last Post: 03-06-2019, 05:01 PM
  2. Replies: 2
    Last Post: 07-28-2016, 10:02 AM
  3. Replies: 4
    Last Post: 07-15-2013, 05:42 AM
  4. [SOLVED] Is there a way to change the error "div/0" in data table to "--" using cond. formatting?
    By Snowpear in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-04-2012, 01:05 PM
  5. "Object required" error with VBA loop rows deleting
    By JKWIN in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-22-2012, 09:31 AM
  6. Replies: 0
    Last Post: 03-10-2011, 05:26 PM
  7. Pivot Table data source "data source contains no visible tables"
    By Jane in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-29-2005, 04:05 PM

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