+ Reply to Thread
Results 1 to 6 of 6

VBA to combine data from two different tables into a result table

  1. #1
    Registered User
    Join Date
    03-02-2015
    Location
    Germany
    MS-Off Ver
    WIN 7
    Posts
    19

    Question VBA to combine data from two different tables into a result table

    Dear all,

    I need help on this,

    I have a specific case where my customer has around 300 stores, but each of these 300 stores act as unique customer. when the contract is closed and there are some conditional targets I have to replicate those targets for all the 300 stores. this is a hard manual process and I would like to automate it a bit with some VBA, but unfortunately my vba skills are not that good.

    here is the challenge:

    I have 3 tables (Stores, Targets and Results), the table "stores" contains all the stores of a specific customer, the table targets contains the targets that should be replicated for all the stores.

    this information should be collected in one table having each store with the respective number of targets. see images below:

    The table containing the Stores:

    stores.jpg

    The table containing the targets:

    targets.jpg

    And the table Results combining targets and stores:

    results.jpg

    I also enclosed the example file

    database.xlsm

    I hope I was able to explain in a way that you will understand.

    Thank you in advance,

    Kind regards,

    Laurel

  2. #2
    Registered User
    Join Date
    03-02-2015
    Location
    Germany
    MS-Off Ver
    WIN 7
    Posts
    19

    Re: VBA to combine data from two different tables into a result table

    Hi,

    It seems that is quite difficult what Im trying to do right?

    KR

    Laurel

  3. #3
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,639

    Re: VBA to combine data from two different tables into a result table

    Please find the attached workbook and click on the button on result sheet to see if this is what you were trying to achieve. The code is on Module2.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by sktneer; 05-06-2015 at 05:49 AM.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  4. #4
    Registered User
    Join Date
    03-02-2015
    Location
    Germany
    MS-Off Ver
    WIN 7
    Posts
    19

    Re: VBA to combine data from two different tables into a result table

    Dear sktneer,

    thank you so much, I was thinking that I was thinking in something quite impossible to be achieved.

    Thank you very much,

    I wish you a great day,

    kind regards,

    Laurel

  5. #5
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,639

    Re: VBA to combine data from two different tables into a result table

    You're welcome Laurel!
    Glad I could help.

    It was not impossible to achieve the task but of course some time was required to devote and I think that's why your thread was not attempted. Otherwise this forum has so many experts who could solve this problem without an issue. But I am glad that the solution provided worked for you.
    And thanks for the feedback as well.

  6. #6
    Registered User
    Join Date
    03-02-2015
    Location
    Germany
    MS-Off Ver
    WIN 7
    Posts
    19

    Red face Re: VBA to combine data from two different tables into a result table

    Dear Sktneer,

    Thank you for your reply, I know that was not an easy task, therefore thank you very much for your help

    I hope Im not pushing it, but I just realized that my targets might change per customer, how can I had this check in the code?

    Im adding some screenshots below:

    in the stores there is the contract_number:

    stores_1.jpg

    and in the targets will have the target number as well:

    targts1.jpg

    I was trying to add the code in this part :

    Please Login or Register  to view this content.
    Thank you so much in advance,

    Regards,

    Laurel

+ 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] Combine 2 tables of data into 3rd table
    By rdingley in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-30-2014, 03:08 PM
  2. [SOLVED] Combine multiple tables into one master table
    By nemoo in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 02-24-2014, 12:33 PM
  3. Replies: 0
    Last Post: 06-13-2013, 07:00 PM
  4. Combine different tables in one table from selected files
    By forfiett in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 02-21-2013, 06:07 PM
  5. How can I combine multiple tables into one pivot table?
    By crsport3 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 02-21-2013, 02:53 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