+ Reply to Thread
Results 1 to 3 of 3

Struggling with link between two Excel tables - It works, but it doesn't. : )

  1. #1
    Forum Contributor
    Join Date
    03-31-2010
    Location
    Norway
    MS-Off Ver
    Excel 365
    Posts
    632

    Struggling with link between two Excel tables - It works, but it doesn't. : )

    Hi all,

    I have a source table with headers starting at row 6 and records starting at row 7.

    I want to create a secondary table which references the source table, but with headers starting at row 12 and records at row 13. This is because I want to have a few statistics and rows calculated on top of the table.

    1. Normally, one can simply enter in cell B13 = Source!B7. This is illustrated in the sheet named "Link1".

    This works for most purposes, but my original table is updated using VBA code extracting data from a database. Whenever I do this, this type of reference is destroyed and the cells in Link 1 shows #REF upon refreshing.

    2. I found a solution for this by finding the name of the table and entering in A13 = SeriesTable[Date]. This lets me also upload by database/VBA without any trouble at all. Data is updated just fine.

    The trouble with this formula is that it references the exact same row in both sheets. So, while I'd want to have the first row of data from Source, Row 7 in Row 13, it gives me Row 13 from Row 13 in Source. So, I miss the first rows of data.

    Is there a clever solution for this?

    I'm attaching a simple mock-up sheet as referenced above.

    Many thanks for all help on this!

    Best regards,

    Elijah
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,369

    Re: Struggling with link between two Excel tables - It works, but it doesn't. : )

    but my original table is updated using VBA code extracting data from a database. Whenever I do this, this type of reference is destroyed and the cells in Link 1 shows #REF upon refreshing.
    How is your VBA entering data into the database? VBA should behave similar to manual operations. Are you pasting data over other data? Are you clearing cells? Deleting cells? Be careful to note the difference between clear and delete. When you delete rows, you will trigger #REF! errors in cells that referenced those cells. Clearing cells, however, leaves the references intact (they will return 0 [1/0/1900 in date format] values), and those references should update correctly if data is entered.

    I think one possible solution is to pay careful attention to how VBA is entering the data and make sure that it is doing so in a way that will not interfere with the existing links. You did not post your VBA code, so I cannot comment further, but the first thing that comes to my mind is to make sure you understand the difference between clear and delete and how references are affected by each operation.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Forum Contributor
    Join Date
    03-31-2010
    Location
    Norway
    MS-Off Ver
    Excel 365
    Posts
    632

    Re: Struggling with link between two Excel tables - It works, but it doesn't. : )

    Hi, MrShorty,

    Thank you for your comment. I didn't create the VBA myself, so I can't say for sure, but I imagine it's deleting rows...

    Anyway, I managed to solve this using PowerQuery in Excel. Turned out to be quite easy in the end.

+ 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: 6
    Last Post: 10-26-2015, 05:51 AM
  2. how can i make this code works for multiple links it only works for one link
    By baig123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-12-2014, 08:38 AM
  3. Struggling to link to a changing pivot
    By Uncle heFTy in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 05-09-2014, 02:31 AM
  4. Cancel printing VBA code doesn't works on excel 2010
    By saesaria in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-28-2013, 06:08 AM
  5. struggling with RAG tables
    By hellsbells1959 in forum Excel General
    Replies: 2
    Last Post: 02-09-2013, 06:10 PM
  6. Struggling to move & link data without access
    By dave45 in forum Excel General
    Replies: 6
    Last Post: 04-15-2012, 07:30 PM
  7. [SOLVED] it works, it doesn work, its works....and so on.
    By Naz in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-30-2005, 09:05 AM

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