+ Reply to Thread
Results 1 to 4 of 4

Column references change when source data is updated

Hybrid View

  1. #1
    Registered User
    Join Date
    11-22-2013
    Location
    Denver, CO
    MS-Off Ver
    Excel 2010
    Posts
    11

    Column references change when source data is updated

    I have a "master" data set that aggregates data from multiple other tabs. The other tabs are updated monthly with new information then the master pulls in the relevant fields from each and allows me to summarize on other tabs further along in the process. Part of the aggregation process starts with one of the tabs, adds a few columns to create unique ID that didn't previously exist in the source data, and then pulls in so corresponding values from the other tables. In the summary tabs, I'm using sumifs to pull in all data that matches 3 different criteria from the master tab. The problem is that once I build out the sumifs formulas, pointing at the Master tab, when I run a macro to update the master tab each month, it deletes all of the data in the tab, copies over a template from another tab, inserts a few columns, and add various calculations. Each time the columns are added by the macro, the references in the sumifs shift and therefore point at the incorrect columns. Thoughts?

    Here is the formula working, followed by the formula after the 2 columns are inserted when the macro is run:

    Before: SUM(SUMIFS('Master All Data'!$AQ:$AQ,'Master All Data'!$I:$I,'21010'!$H24,'Master All Data'!$P:$P,'21010'!$B$2,'Master All Data'!$M:$M,{"v0310","V0315","V0320"}))

    After: SUM(SUMIFS('Master All Data'!$AS:$AS,'Master All Data'!$K:$K,'21009'!$H23,'Master All Data'!$R:$R,'21009'!$B$2,'Master All Data'!$O:$O,{"v0310","V0315","V0320"})) - Everything shifted 2 columns.

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Column references change when source data is updated

    If you use named ranges in the sumifs, they would always refer to the same cell references.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  3. #3
    Registered User
    Join Date
    11-22-2013
    Location
    Denver, CO
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Column references change when source data is updated

    That didn't work. When I name the range, the range shifts also when the columns are inserted. Same issue as above. When you look at the definition for the named column range, it is the same locked column references, that updates as that column moves.

  4. #4
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Column references change when source data is updated

    In the macro to update your master, include a portion that reloads your formulas.

+ 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] VBA: Change text in column if there is updated data on another sheet
    By maddyrafi1987 in forum Excel Programming / VBA / Macros
    Replies: 39
    Last Post: 03-03-2018, 09:20 AM
  2. [SOLVED] Data validation lists change source designation when list data is updated.
    By frenurks in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-28-2015, 06:52 AM
  3. how to update listbox list
    By jgcramer in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-16-2013, 04:19 AM
  4. Replies: 15
    Last Post: 02-01-2013, 05:19 AM
  5. Replies: 3
    Last Post: 06-14-2012, 02:57 PM
  6. What if I DON'T want the chart to be updated when source data changes?
    By arhooley in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 06-09-2005, 01:05 AM
  7. [SOLVED] Applying a currency rate that doesn't change when source updated
    By Redsmartie in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-01-2005, 02:06 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