+ Reply to Thread
Results 1 to 12 of 12

Transfer from one table to another auto sorting table

  1. #1
    Registered User
    Join Date
    06-28-2017
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    24

    Transfer from one table to another auto sorting table

    Hello guys, im looking for a macro that would help to generate the table alone as i add new entries.

    Here is the table that is going to hold all the information :

    TABLE1111.PNG

    A score is gathered every weekday as the dates on the header show (25-Jun-17 is weekend), it would be nice that the dates could automatically add as I populate the table.
    As this table will have over 1000 addresses and roughly 300 days a year.

    Here is two options for my Data Entry Tables :

    TABLE22222.PNGTABLE33333.PNG

    The data in the orange table would be entered manually each day that the scores are collected, I'm looking for code for the "Add Data To Blue Table" button that would transfer all that data from the orange table to the blue one.
    Now,
    - if the address is already in the blue table I would like the score to be added to the its right in the proper date column.
    - if the address is NOT in the blue table, the Macro would create a new column for the address prior to adding its score in the correct date column.

    Any tips and advice is greatly appreciated !!

    Thanks for your time,

    Jeremie

    Ignore Bottom Attached File
    Attached Images Attached Images

  2. #2
    Valued Forum Contributor
    Join Date
    07-10-2017
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2013
    Posts
    430

    Re: Transfer from one table to another auto sorting table

    You can give this a try (you will need to change the worksheet names - I used sheet1 for the sheet containing the orange data table and sheet2 for the sheet containing the final blue table).
    Please Login or Register  to view this content.
    Edit - should probably have mentioned that this is for the first orange data table setup
    Edit #2 - this assumes you already have all the dates written in row 5 of your data table. If you need the code to populate that row it will have to be edited
    Last edited by danielexcelvba; 07-26-2017 at 11:40 AM.

  3. #3
    Registered User
    Join Date
    06-28-2017
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    24

    Re: Transfer from one table to another auto sorting table

    Hey danielexcelvba,

    Thank you for responding

    There seems to be a error in the code " Run-time Error '91': Object variable or With block variable not set " when I run it.

    It adds only one instant of the new area in question (Petico,56, Sali) then (Petico,57, Sali) the second time I run the code (after stopping debugger and running again).

    Then I run it a third time for (petico , 58 , Sali).

    After that, once there is no addresses in the orange table that the blue one doesn't have, the code runs without any errors, but doesn't seem to be transferring the 'SCORE' .

    Here are the Results

    TABLE22222.PNGTABLE1111.PNG

    The score doesn't seem to be added to the new or the old dates, I will be looking at it and try to figure it out, I will update as i go.

    Thanks

    Jeremie

    Forgot to say where the error was ..

    Please Login or Register  to view this content.
    Last edited by Noobulon; 07-26-2017 at 12:47 PM.

  4. #4
    Valued Forum Contributor
    Join Date
    07-10-2017
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2013
    Posts
    430

    Re: Transfer from one table to another auto sorting table

    Hmm would it be possible for you to attach a desensitized workbook so i could try it out? It's working on my sample data.

  5. #5
    Valued Forum Contributor
    Join Date
    07-10-2017
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2013
    Posts
    430

    Re: Transfer from one table to another auto sorting table

    Without seeing the workbook, the only thing I could think of is maybe you don't have 28-jul-17 in your blue table? Is it possible it's supposed to be 28-jun-17 (based on your screenshots)?

  6. #6
    Registered User
    Join Date
    06-28-2017
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    24

    Re: Transfer from one table to another auto sorting table

    Sure that would be great!
    Attached Files Attached Files

  7. #7
    Valued Forum Contributor
    Join Date
    07-10-2017
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2013
    Posts
    430

    Re: Transfer from one table to another auto sorting table

    Ah yes, this is why I asked earlier if you had all the dates in row 5 of your blue workbook. This code is searching the blue table for the date found in the orange table. If you don't have all the dates written out, I'll have to edit it so that it fills in the date heading

  8. #8
    Registered User
    Join Date
    06-28-2017
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    24

    Re: Transfer from one table to another auto sorting table

    And no I do not have that date yet, i was thinking it would create a column automatically, im guessing i can just expand it by hand

  9. #9
    Registered User
    Join Date
    06-28-2017
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    24

    Re: Transfer from one table to another auto sorting table

    Ohhh ok, i understand what you mean now!!

  10. #10
    Valued Forum Contributor
    Join Date
    07-10-2017
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2013
    Posts
    430

    Re: Transfer from one table to another auto sorting table

    I think this should solve the problem
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    06-28-2017
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    24

    Re: Transfer from one table to another auto sorting table

    HUGE thanks Daniel, it works like a charm.

  12. #12
    Valued Forum Contributor
    Join Date
    07-10-2017
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2013
    Posts
    430

    Re: Transfer from one table to another auto sorting table

    You're welcome If you don't have any other questions please mark the thread as solved (in thread tools)

+ 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] Auto-Sorting table
    By Odracir in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-29-2015, 07:00 PM
  2. UserForm to transfer items from one table to another table in the next empty cell...
    By aneese11 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-04-2012, 10:31 AM
  3. Auto-Sorting A Two-Column Table
    By hashamyim in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-15-2012, 08:04 AM
  4. [SOLVED] An auto-sorting table in MS Excel 2010
    By Arithalion in forum Excel General
    Replies: 2
    Last Post: 05-11-2012, 09:40 AM
  5. Auto sorting league table
    By Alexvs in forum Excel General
    Replies: 4
    Last Post: 12-12-2010, 04:42 PM
  6. Auto sorting a table
    By molemeister in forum Excel General
    Replies: 3
    Last Post: 06-16-2010, 12:39 PM
  7. [SOLVED] [SOLVED] Auto sorting a table
    By JOHN ROBERTS in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-29-2005, 11: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