+ Reply to Thread
Results 1 to 6 of 6

Redistribute Inventory to Locations Where There is Need

  1. #1
    Registered User
    Join Date
    04-06-2012
    Location
    NYC
    MS-Off Ver
    Excel 2010
    Posts
    5

    Question Redistribute Inventory to Locations Where There is Need

    Hello.

    Sample Data is attached.

    I have a fun problem to solve regarding inventory at specific warehouses. Each warehouse should have x inventory referred to as "Inventory Needed". Some warehouses have inventory above this level ("Excess") while other warehouses have inventory less than what is needed ("Need"). The inventory of each "Product" on hand at each warehouse is referred to as "Total Inventory Available".

    Warehouse Name Product Inventory Needed Total Inventory Available Excess Need
    Orange Drive 406200 3 0 0 3
    Purple Blvd. 406200 6 7 1 0
    Green Street 407969 4 5 1 0
    Yellow Blvd. 407969 9 12 3 0
    Blue Street 414017 3 0 0 3
    Green Street 414017 5 3 0 2
    Orange Drive 414017 5 8 3 0
    Orange Drive 443029 7 8 1 0
    Red Street 443029 4 2 0 2
    Blue Street 454392 6 9 3 0
    Orange Drive 454392 5 5 0 0
    Red Street 476585 10 10 0 0
    Blue Street 478624 4 3 0 1
    Red Street 478624 7 8 1 0

    I would like to begin writing some code to that would loop through each warehouse and identify if there is any excess units of that product at a different warehouse that can be moved to fill any inventory needs. The end result would be a print out of each inventory transfer that needs to occur in order to redistribute including the name of the sending warehouse, the product, quantity being transferred, and the receiving warehouse.

    Sending Warehouse Product Quantity Receiving Warehouse
    Purple Blvd. 406200 1 Orange Drive
    Orange Drive 414017 3 Blue Street
    Orange Drive 443029 1 Red Street
    Red Street 478624 1 Blue Street

    I have attempted to achieve this result using some fun and fancy rolling formulas involving waaaay too many columns. It worked-ish with the biggest issue being my output including the redistribution of the same inventory to multiple different warehouses.

    I did my best to search for a thread that covered my request, but could not find anything. Does anyone have any code that I can explore? Or a link to a similar thread or topic you find online? I'm certain I'm not finding any results because of poor wording on my part.

    Thank you in advance!
    Attached Files Attached Files

  2. #2
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Redistribute Inventory to Locations Where There is Need

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

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Redistribute Inventory to Locations Where There is Need

    If i can add my 5 cents …
    Please Login or Register  to view this content.
    Blue parts will help to handle such situation as:

    Blue Street 414017 3 0 0 3
    Green Street 414017 5 3 0 3
    Orange Drive 414017 5 8 5 0
    Red Street 414017 5 8 1 0

    --->

    Orange Drive 414017 3 Blue Street
    Orange Drive 414017 2 Green Street
    Red Street 414017 1 Green Street

    Green will write ammended array back to worksheet (I expect in real life the same as it was original - but of course it is always a good idea to show both "before" and "after" situations.
    Best Regards,

    Kaper

  4. #4
    Registered User
    Join Date
    04-06-2012
    Location
    NYC
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Redistribute Inventory to Locations Where There is Need

    Thank you both so very much. This is exactly what I needed.

    I am doing my best to now actually learn VBA rather than just copy, pasting, and creating little spreadsheet abominations.

    Would you mind explaining the logic behind this code? What is it doing?

    Or alternatively, if you have any websites or other threads you can recommend I read up on to help, I would gladly like to do that.

    Either way, thank you both again. I'm going to do my best to comment the code myself to try to gain some understanding of what I think is going on.

  5. #5
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Redistribute Inventory to Locations Where There is Need

    With comments...
    Please Login or Register  to view this content.
    I started just like this - asking questions on forums, then attempting to answer some as my knowledge grew. Helping others helps me stretch my knowledge and I learn as I help. For a site to learn good vba basics, I would suggest Excel Macro Mastery, and for a book on all of excel, J. Walkenbach's Spreadsheet Bible, although I don't think it's in print now. Good luck!
    Last edited by dangelor; 06-06-2020 at 09:31 AM.

  6. #6
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Redistribute Inventory to Locations Where There is Need

    Also comments to my propositions:
    Please Login or Register  to view this content.

+ 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. redistribute numbers using solver
    By ahmed bassam in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-16-2019, 09:01 AM
  2. Formula for Inventory using one quantity in multiple locations
    By shellymac in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 08-04-2018, 02:55 PM
  3. Inventory of equipment, but different locations
    By MrLomax in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-25-2017, 05:08 AM
  4. Redistribute data in excel
    By kay007 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-11-2016, 09:56 AM
  5. Incorporating Google Map inside spreadsheet having Two locations to show locations
    By phanikumarbh in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-22-2015, 09:10 AM
  6. Redistribute Tables After Import (Dynamically)
    By AlvaroSiza in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-10-2011, 12:02 PM
  7. Trying ti figure out Inventory By Product ID for Multile Locations.
    By milobloom in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-11-2006, 08:12 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