+ Reply to Thread
Results 1 to 11 of 11

Get data from several tables at the bottom of "master" table

  1. #1
    Registered User
    Join Date
    09-18-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    35

    Get data from several tables at the bottom of "master" table

    I have several employees who photograph many clients (sports teams) every week, and I'd like to have all their data in one customer database. So what I basically have is several tables (who are all the same) and my own database, which expands every week depending on how much clients the photographers had.

    There are two problems:
    1) I'd like to have the adding to my table more or less atomised, not that I have to open 50 files (of 50 employees) and copy/paste them at the end of my table, every week.
    2) My own table has more columns, so every column of a photographer must be assigned to a different column of my table.

    To get it a little more tentative, the employees' columns are something like this:
    1) Date 2) Employee 3) Client 4) Price
    And I have something like
    1) Enumeration 2) Date 3) Employee 4) Client 5) Status 6) Price 7) Profit
    So how do I get all the rows of several employees at the bottom of my table, and in the right column?

    Here's a sample file, I've put the one of the photographers's weekly database in a second sheet. The references/lookups of the main sheet don't work now because I've deleted them.

    Thanks a lot in advance!
    Last edited by Stormbringer; 10-11-2013 at 12:15 PM. Reason: Added sample file

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Get data from several tables at the bottom of "master" table

    why not attach a sample file ?
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    09-18-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Get data from several tables at the bottom of "master" table

    Thanks, I just did in the opening's post.

  4. #4
    Registered User
    Join Date
    09-18-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Get data from several tables at the bottom of "master" table

    No ideas to solve this?

    What I do now is working with two extra temporary tables, where I can copye the whole photographer's table, which is a little faster than copying every column of every photographer. But still not ideal!

  5. #5
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Get data from several tables at the bottom of "master" table

    a good sample file has the original structure with dummy data, not without data

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Get data from several tables at the bottom of "master" table

    Hi, Stormbringer,

    do all sets look like the given example? If so you may add all informtion from every column in any sheet (preferably all files are located in one folder) to your mayin workbook You could utilize an Array stating the column numbers into which to copy the data like
    Please Login or Register  to view this content.
    and loop through the columns to copy (please mind that the array starts with 0).

    HTH,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  7. #7
    Registered User
    Join Date
    09-18-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Get data from several tables at the bottom of "master" table

    Quote Originally Posted by patel45 View Post
    a good sample file has the original structure with dummy data, not without data
    Ok:
    Freelancers - this is the file that the photographers fill in every week, and send their own file to me. So I get several of these.
    Main - this is the main file, where I want to get all the data from the Freelancers.xlsx at the bottom of this Main.xlsx table in the corresponding column.

    Quote Originally Posted by HaHoBe View Post
    Hi, Stormbringer,

    do all sets look like the given example? If so you may add all informtion from every column in any sheet (preferably all files are located in one folder) to your mayin workbook You could utilize an Array stating the column numbers into which to copy the data like
    Please Login or Register  to view this content.
    and loop through the columns to copy (please mind that the array starts with 0).

    HTH,
    Holger
    Hi Holger! Thanks for the reply. But this is VBA, right? I'm not into that, yet, maybe I'll start with a tutorial later. I wonder though if your code copies the data at the bottom of the table? So if I have 10 rows in the main file, and I get 3 files (let's say they all have 5 rows of data) wherefrom I need to copy the data to the main file, the pasting should be on the 11th, 16th, and 21th row respectively for eacht file with 5 rows.

  8. #8
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Get data from several tables at the bottom of "master" table

    Hi, Stormbringer,

    the code posted is for copying the contents of one workbook which will be opened for this. Code for a standard module:
    Please Login or Register  to view this content.
    You may try the code by pressing ALT+F8 but you need to enable macros for doing so.

    Ciao,
    Holger
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    09-18-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Get data from several tables at the bottom of "master" table

    Hi Holger,

    Wow, you've made a whole complete script! Enormous thanks for that!

    But I don't see any effect when I run the script. I'm afraid I don't know how the reference to the data-file (Freelancers.xlsx) is made, I can't recognise it in your code either so I can rename the files if necessary. Can you explain what should be done to make the script work please?

    Ciao, Arthur

  10. #10
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Get data from several tables at the bottom of "master" table

    Hi, Arthur,

    I'm afraid I don't know how the reference to the data-file (Freelancers.xlsx) is made, I can't recognise it in your code either so I can rename the files if necessary.
    With activated macros a box should appear where you may make your choice which file to take. There is no hardcoded reference to any file except to the file holding the code. Please check the seuroty settings and allow macros to run.

    Ciao,
    Holger

  11. #11
    Registered User
    Join Date
    09-18-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Get data from several tables at the bottom of "master" table

    Hi Holger,

    I tried it again in Windows (I'm using mainly Excel for Mac), and there it works flawlessly! Also after copying it to the actual file. Again, enormous thanks for the great help, very appreciated!

    Ciao, Arthur

+ 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: 1
    Last Post: 06-06-2013, 06:28 PM
  2. Replies: 2
    Last Post: 06-06-2013, 12:45 PM
  3. Replies: 1
    Last Post: 03-15-2013, 01:25 PM
  4. Opening 4 excel files, copying set table data and pasting into "master file".
    By Belloni in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-29-2012, 09:50 AM
  5. Replies: 5
    Last Post: 09-19-2008, 04:02 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