+ Reply to Thread
Results 1 to 28 of 28

copy data from multiple sheets to one and update inventory

  1. #1
    Forum Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    395

    copy data from multiple sheets to one and update inventory

    hello
    i have many sheets " purchase , sales, returns sales ,returns purchase " every in voice in theses sheets should copy to sheet data i put the result in sheet data and at the same time updating the inventory in sheet stock it should subtracting the quantity from "sheets sales " &" returns purchase " and add to the quantity from sheets " returns sales " and " purchase "
    if my post is not clear please tell me
    thanks in advance
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    395

    Re: copy data from multiple sheets to one and update inventory

    any helps experts?

  3. #3
    Forum Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    395

    Re: copy data from multiple sheets to one and update inventory

    any helps guys?

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

    Re: copy data from multiple sheets to one and update inventory

    Small datasets so this easy enough to understand...No need for array...
    Sheets Data & Returns Sales has trailing space...
    Please Login or Register  to view this content.
    Last edited by sintek; 03-13-2021 at 08:01 AM. Reason: Updated code...
    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 Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    395

    Re: copy data from multiple sheets to one and update inventory

    wow ! it's great about sheet data but I need update in sheet inventory when fill invoices from four sheets (purchase , sales , returns purchase,returns sales) should summing and subtracting I put some comments inside in the file i no Know if the explanation is not clear please tell me if it's not clear

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

    Re: copy data from multiple sheets to one and update inventory

    Update stock sheet with expected result...And is this overwritten all the time?

  7. #7
    Forum Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    395

    Re: copy data from multiple sheets to one and update inventory

    yes it should do that automatically when change in four sheets

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

    Re: copy data from multiple sheets to one and update inventory

    So...Provide sample with expected result in Stock sheet so I can see...

  9. #9
    Forum Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    395

    Re: copy data from multiple sheets to one and update inventory

    please check my file and some explanation
    Attached Files Attached Files

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

    Re: copy data from multiple sheets to one and update inventory

    Is data sheet a history of all individual transactions of the 4 sheets...

  11. #11
    Forum Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    395

    Re: copy data from multiple sheets to one and update inventory

    you mean sheet "stock" ?

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

    Re: copy data from multiple sheets to one and update inventory

    No....Data....
    Does data carry on growing all the time ...

  13. #13
    Forum Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    395

    Re: copy data from multiple sheets to one and update inventory

    yes of course it will increase the data my uploaded file is a simple to understand what I want

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

    Re: copy data from multiple sheets to one and update inventory

    Please Login or Register  to view this content.
    Last edited by sintek; 03-13-2021 at 10:18 AM.

  15. #15
    Forum Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    395

    Re: copy data from multiple sheets to one and update inventory

    thanks I will test your code and I'll inform you what happens it takes some time

  16. #16
    Forum Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    395

    Re: copy data from multiple sheets to one and update inventory

    it's perfect , but the code doesn't deal if I have no data in any invoice for instance If I fill data today sales but there is no invoices purchase or returns then the code will shows error in this line Application-defined or Object-defined error
    HTML Code: 
    and crashed sometimes I have sales and purchase and often have returns and purchase without sale so may you fix it please ?

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

    Re: copy data from multiple sheets to one and update inventory

    Oops forgot the red part...see amended code above...

  18. #18
    Forum Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    395

    Re: copy data from multiple sheets to one and update inventory

    I note it gives the wrong values in sheet stock I put the right value for one brand in column n just I would for you click the macro and compare with column n to see where is the problem
    Attached Files Attached Files

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

    Re: copy data from multiple sheets to one and update inventory

    Change this snippet to suite...
    Please Login or Register  to view this content.
    If Transaction must - then add * -1...if not remove it...

    No time now...can see Monday

  20. #20
    Forum Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    395

    Re: copy data from multiple sheets to one and update inventory

    thanks for your time I will test it and inform you

  21. #21
    Forum Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    395

    Re: copy data from multiple sheets to one and update inventory

    unfortunately it doesn't work

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

    Re: copy data from multiple sheets to one and update inventory

    What is calculation

    If PUR - add to stock
    If SALE - subtract from stock
    If RPUR - add to stock
    If RSALE - subtract from stock

    or...

    This gives correct answer
    Please Login or Register  to view this content.
    Last edited by sintek; 03-13-2021 at 11:43 AM.

  23. #23
    Forum Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    395

    Re: copy data from multiple sheets to one and update inventory

    calculation should be

    If PUR - add to stock
    If SALE - subtract from stock
    If RPUR - subtract to stock
    If RSALE - add from stock

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

    Re: copy data from multiple sheets to one and update inventory

    Quote Originally Posted by MKLAQ View Post
    calculation should be

    If PUR - add to stock
    If SALE - subtract from stock
    If RPUR - subtract to stock
    If RSALE - add from stock
    K post 22 snippet change solves then...

  25. #25
    Forum Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    395

    Re: copy data from multiple sheets to one and update inventory

    million thanks for your solution you give me a big favor your legend
    just I'm asking for clear the data after run macro should clear this range from a20: g for these sheets after copy ("Purchase", "Sales", "Returns Purchase", "Returns Sales ")
    i try add this line
    HTML Code: 
    to become like this
    HTML Code: 
    but it clears also the headers and sometimes gives me error , the aim that maybe I repeat running macro Unintentionally then it summing and subtracting repeatedly and gives me wrong values in stock
    thanks again

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

    Re: copy data from multiple sheets to one and update inventory

    Close...
    Please Login or Register  to view this content.

  27. #27
    Forum Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    395

    Re: copy data from multiple sheets to one and update inventory

    @sintek actually I was wrong about clear this range a20:g it supposes a20:e because F,G contains formulas
    also when I clear the range it also delete formatting data and delete dropdwn in col B,C,D after many tries I've found this properties
    HTML Code: 
    it just clear the contents , and it successes also if I run the macro without there are data in invoices then it shows error in this line
    HTML Code: 
    I added this line before it
    HTML Code: 
    also it successes I try learning simple things now every thing works excellently that's because of you and I attach final file to others members take advantage from this project
    thank you so much for support me
    Attached Files Attached Files
    Last edited by MKLAQ; 03-13-2021 at 04:06 PM.

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

    Re: copy data from multiple sheets to one and update inventory

    Glad you got it sorted...Tx for rep +

+ 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] merge duplicated data across multiple sheets and sum & subtracting (update inventory)
    By abdo meghari in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 01-02-2021, 04:35 AM
  2. modified code mr .jindon merge duplicated data across multiple sheets(update inventory)
    By abdo meghari in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-02-2021, 03:54 AM
  3. [SOLVED] Get data from multiple sheets and update in summary sheet
    By shyampanda in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-12-2019, 11:01 AM
  4. VBA to automatically update and copy data to other sheets
    By kary4567 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 12-29-2018, 12:01 PM
  5. [SOLVED] Multiple sheets data update in result sheet
    By shyampanda in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-05-2018, 10:08 AM
  6. [SOLVED] how to automatically update data in multiple sheets
    By Eftychia in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 04-01-2014, 08:43 PM
  7. Replies: 0
    Last Post: 12-01-2012, 08:04 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