+ Reply to Thread
Results 1 to 29 of 29

Transferring data to a new table when a certain condition is met

  1. #1
    Registered User
    Join Date
    04-15-2017
    Location
    australia
    MS-Off Ver
    office 365
    Posts
    46

    Transferring data to a new table when a certain condition is met

    Hey guys, bare with me if i dont make a whole lot of sense, im rather new to excel and havnt even touched base on codes...

    Basically i have a fully functioning spreadsheet for orders and inventory... i have a table i can manually input orders in which then works with the inventory table... the problem i have is i want to make another table for orders that havnt yet arrived.. with a true/false button that i can click when the order has arrived. Which can then automatically transfer that line of data to the "completed orders" table.

    Example: row 1 in "pending orders" = not complete, when completed, click the arrived button to send that line of data to row 1 of "completed orders"

    Im assuming this is done through the VBA, If anyone could assist me with getting such a task complete or knows a good tutorial i can follow and/or watch to learn this that would be great, thanks in advance!

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Transferring data to a new table when a certain condition is met

    Hi joe and welcome to the forum,

    Instead of writing any VBA, why don't you simply put an X next to the orders than have been completed? You could also put a PO for pending order in the same or other column. That way you could filter your one table and not have to copy data. Make sense? If not then post a sample of what your tables look like and we can do a better job trying to answer this question.

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    04-15-2017
    Location
    australia
    MS-Off Ver
    office 365
    Posts
    46

    Re: Transferring data to a new table when a certain condition is met

    First off thanks for the fast reply! Truely appreciate it... I have created a before/after example worksheet for you.. Maybe then you will understand better what im trying to accomplish

    The before sheet has the example tracking order with 50 items of each type as an example, i have created a true/false toggle button because thats all i know how to do as of now... Basically when that order has arrived i would like to be able to click a button or checkbox (not fussed) that will then automatically transfer all the values of that specific row only to go to the completed orders... which will then work with the formulas i have set for the rest of the spreadsheet
    Let me know if the file attached or not (im pretty sure it worked) thanks again!
    Attached Files Attached Files

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: Transferring data to a new table when a certain condition is met

    Hi there joepekimo

    Welcome to the Forum. Why not upload a sample workbook with a before & after scenario making sure that your desired solution is shown - mock up the results manually if need be.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Transferring data to a new table when a certain condition is met

    Hey Joe,

    Once again, I'd make a single table with your orders and simply add a column where I put an X if you've shipped it.

  6. #6
    Registered User
    Join Date
    04-15-2017
    Location
    australia
    MS-Off Ver
    office 365
    Posts
    46

    Re: Transferring data to a new table when a certain condition is met

    I just attached a before and after workbook in my most recent comment? Did it not work? it is showing up for me in my comment.

  7. #7
    Registered User
    Join Date
    04-15-2017
    Location
    australia
    MS-Off Ver
    office 365
    Posts
    46

    Re: Transferring data to a new table when a certain condition is met

    But i dont want the inventory to update unless it has arrived, how do i do that? Id assume with an IF statement?

  8. #8
    Registered User
    Join Date
    04-15-2017
    Location
    australia
    MS-Off Ver
    office 365
    Posts
    46

    Re: Transferring data to a new table when a certain condition is met

    I would kind of prefer to have a separate table for pending orders to easily view both at the same time though..

  9. #9
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Transferring data to a new table when a certain condition is met

    Hey Joe,

    If you keep both is a single table, you can create a filter (on the data tab) and easily show all those pending.
    See this site and see the advantages of keeping your data in a single table:

    http://www.techrepublic.com/blog/10-...-table-object/

  10. #10
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: Transferring data to a new table when a certain condition is met

    Hi joe

    This will do what you want.
    Please Login or Register  to view this content.
    Last edited by sintek; 04-15-2017 at 04:03 AM. Reason: Removed Select, selection

  11. #11
    Registered User
    Join Date
    04-15-2017
    Location
    australia
    MS-Off Ver
    office 365
    Posts
    46

    Re: Transferring data to a new table when a certain condition is met

    thanks for the reply and the code, although im not sure how to use it :/
    i right clicked my sheet and clicked view code, pasted that and saved it.. whats next?

    thanks!

  12. #12
    Registered User
    Join Date
    04-15-2017
    Location
    australia
    MS-Off Ver
    office 365
    Posts
    46

    Re: Transferring data to a new table when a certain condition is met

    Also marvin, if i use your method, how can i stop the unarrived orders from being totaled untill they are arrived, as that is the whole point of having 2 seperate order types.

  13. #13
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: Transferring data to a new table when a certain condition is met

    Quote Originally Posted by joepekimo View Post
    thanks for the reply and the code, although im not sure how to use it :/
    i right clicked my sheet and clicked view code, pasted that and saved it.. whats next?

    thanks!
    Insert a Command button on your sheet and put code within

  14. #14
    Registered User
    Join Date
    04-15-2017
    Location
    australia
    MS-Off Ver
    office 365
    Posts
    46

    Re: Transferring data to a new table when a certain condition is met

    How do i link it to the cells i wish to use it for? i have made the button and put the code in it .

  15. #15
    Registered User
    Join Date
    04-15-2017
    Location
    australia
    MS-Off Ver
    office 365
    Posts
    46

    Re: Transferring data to a new table when a certain condition is met

    im so confused sorry i have no idea what im doing :/

  16. #16
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: Transferring data to a new table when a certain condition is met

    Are you not wanting to move all the info over if the value in your Sheet called Before's Range("A:A") = True

    Sorry, I'm confused....Let me think about this one
    Last edited by sintek; 04-15-2017 at 04:44 AM.

  17. #17
    Registered User
    Join Date
    04-15-2017
    Location
    australia
    MS-Off Ver
    office 365
    Posts
    46

    Re: Transferring data to a new table when a certain condition is met

    i just want a button that can shift the line of data to another line of data of my choice

  18. #18
    Registered User
    Join Date
    04-15-2017
    Location
    australia
    MS-Off Ver
    office 365
    Posts
    46

    Re: Transferring data to a new table when a certain condition is met

    like a seperate button for each line of data, as i will have multiple pending orders at once..

    for example.. move row 3 data to row 10 when button is clicked.

  19. #19
    Registered User
    Join Date
    04-15-2017
    Location
    australia
    MS-Off Ver
    office 365
    Posts
    46

    Re: Transferring data to a new table when a certain condition is met

    I just need a button that can shift a row of data to another row of data that i specify when a button is clicked.

    for example: Move row 3 data to row 10 data when button is clicked.

  20. #20
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: Transferring data to a new table when a certain condition is met

    Have a look at attached workbook. When you press Toggle Button Arrived, value becomes True then Press Move to Arrived.
    Attached Files Attached Files

  21. #21
    Registered User
    Join Date
    04-15-2017
    Location
    australia
    MS-Off Ver
    office 365
    Posts
    46

    Re: Transferring data to a new table when a certain condition is met

    that works exaclty how i wanted, however, what if i already have something else in row 1, is there a way for it to remove it to the next available row or?

  22. #22
    Registered User
    Join Date
    04-15-2017
    Location
    australia
    MS-Off Ver
    office 365
    Posts
    46

    Re: Transferring data to a new table when a certain condition is met

    i dont want it to replace a current order

  23. #23
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: Transferring data to a new table when a certain condition is met

    Look at this sample using pgspringers code...Think this is way to go...You select in Column a from dropdown true or false
    Attached Files Attached Files

  24. #24
    Registered User
    Join Date
    04-15-2017
    Location
    australia
    MS-Off Ver
    office 365
    Posts
    46

    Re: Transferring data to a new table when a certain condition is met

    this is perfect, how can i recreate this on my workbook? thanks so much

    If you would rather link me to a tutorial so i can learn myself that would be good too

  25. #25
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: Transferring data to a new table when a certain condition is met

    Joe, we all have to start somewhere and this Forum is the perfect place to learn. With that been said, I always first google the .... out of something to see if i can resolve the issue myself...If not then approach the forum....Most of the time, ones requirement has already been resolved within previous posts.

  26. #26
    Registered User
    Join Date
    04-15-2017
    Location
    australia
    MS-Off Ver
    office 365
    Posts
    46

    Re: Transferring data to a new table when a certain condition is met

    And im happy to learn, are you able give me the type of code this is so i can google it?

  27. #27
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: Transferring data to a new table when a certain condition is met

    Have a look at this link for the True/false Dropdown in Range A
    https://support.office.com/en-us/art...6-eff3ce5f7249
    This is the code which should be placed in a command Button on your sheet
    Please Login or Register  to view this content.

  28. #28
    Registered User
    Join Date
    04-15-2017
    Location
    australia
    MS-Off Ver
    office 365
    Posts
    46

    Re: Transferring data to a new table when a certain condition is met

    If i were to re-use that code, what part of it do i change to tailor to my tables... i see it says.. table 5 and table 25, where do i get these values from? I have been googling the .... out of this aswell as asking these forums and most people just give the answer instead of explaining how to get that answer, that code to me is just a bunch of letters and i have no idea how to tailor that to my tables lol. Is this a cut/paste code? I just dont know what to even google or what this is called at all.

  29. #29
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: Transferring data to a new table when a certain condition is met

    As per your sample Upload, On Sheets("Before")
    Pending Orders is named Table5
    Arrived Orders is named Table525

    If you click in any of the cells within your Tables, and you press the design Tab above....You can see the name of the Table
    Table-No.gif

+ 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: 02-01-2014, 03:12 AM
  2. Transferring Data from Immediate VBA window to a table
    By specialk9203 in forum Access Tables & Databases
    Replies: 3
    Last Post: 03-22-2013, 10:41 AM
  3. Transferring data from one table to another
    By Jaspal in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-03-2012, 09:13 AM
  4. Transferring data from 1 table to another
    By heinensk in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-12-2012, 04:12 PM
  5. Transferring automatically data from one table into another
    By davvman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-06-2010, 06:36 AM
  6. Transferring filtered data from one table to another
    By ehassell01 in forum Excel General
    Replies: 3
    Last Post: 01-24-2010, 10:54 AM
  7. Look for code to use for transferring data monthly with certain condition
    By mingali in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-15-2009, 02:04 PM
  8. Transferring Excel data to Word table
    By JillB in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-08-2009, 03:13 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