+ Reply to Thread
Results 1 to 8 of 8

Need help creating Macro that tracks inventory

  1. #1
    Forum Contributor
    Join Date
    02-18-2020
    Location
    Ottawa, ON
    MS-Off Ver
    Professional Plus 2010
    Posts
    122

    Lightbulb Need help creating Macro that tracks inventory

    Hi All! I've always come here for help when I've not been able to find the answer online or in Youtube videos and it's never failed. I believe I have quite a tricky macro that I need to make here.

    I've created an spreadsheet for creating recipes (Ejuice), as making them myself is not only healthier (as I know what's in it), but it's cheaper and I can make them with no nicotine. Here are the worksheets I have:


    Recipes: Self explanatory, this tab holds my recipes and how to make them. When I create a new recipe, I copy a template in from the "Template" tab, enter all the flavors within the recipe, then enter the percentages of each flavor.

    Template: Self explanatory. I copy this and paste it into the recipe tab when creating a new recipe.

    Flavors: This sheet shows every single flavor concentrate (Column B), and shows how much I have of each flavor, in (ml) in column C.


    What I want to happen is, when I make a recipe, I want to click a button and a macro will go into the "Flavors" worksheet and subtract (from my inventory) exactly what was used in that recipe. So for example, if that recipe used 5ml of Apple flavoring and 1.5ml of Bavarian Cream flavoring, it would go into my "Flavors" worksheet, find those flavors, and subtract the amounts in (ml) from what I have in my inventory. Sometimes I make 10 recipes at a time, and it can be extremely cumbersome to do this manually for 40 flavorings. All of the data is there, I just don't know how to combine it to make it do what I want. I'm happy to create another worksheet specifically for this macro, so that it is only doing inventory tracking for one recipe at a time; I think that would make it much simpler, though you guys are the experts, not me.

    Document is attached, and I'll be MORE than happy to answer ANY questions that might help with the creation of this macro.

    Flavor list and inventory amount in (ml) is: B2:C145
    Recipe flavors are in column: B (Recipes worksheet)
    ml value for each flavor in column: C (Recipes worksheet)

    I already have a VLOOKUP formula beside each flavor (Recipes tab, column A) that searches the "Flavors" worksheet and let's me know if I have it in stock. Maybe this can help somehow?

    Thanks so much in advance, you guys are honestly Rockstars and groomed me from being useless in excel, to quite proficient in it.
    Attached Files Attached Files
    Last edited by Keegan1116; 10-06-2020 at 12:03 PM.

  2. #2
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Need help creating Macro that tracks inventory

    Up to How many recipes can you have on the Recipe tab?

  3. #3
    Forum Contributor
    Join Date
    02-18-2020
    Location
    Ottawa, ON
    MS-Off Ver
    Professional Plus 2010
    Posts
    122

    Re: Need help creating Macro that tracks inventory

    It's unlimited, really. In my actual workbook (the attached is a simpler version) I have about 30. In the attached document, I only have 2. But I'm happy with creating a new worksheet for this macro, so that when I want to run it, I can copy the recipe into that worksheet, and the run the macro on just the one recipe at a time (if that's easier). Otherwise, I'm not sure how we can go about selecting a specific recipe every time, in a list full of recipes, short of creating buttons for each and every recipe.

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Need help creating Macro that tracks inventory

    Try:
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  5. #5
    Forum Contributor
    Join Date
    02-18-2020
    Location
    Ottawa, ON
    MS-Off Ver
    Professional Plus 2010
    Posts
    122

    Re: Need help creating Macro that tracks inventory

    Awesome!! It works, and for multiple recipes at the same time. Thank you very much for taking the time to do this. One question, If I wanted to have another button for doing the exact opposite (adding the flavors instead of subtracting) in case I make a mistake, is it an easy modificaiton?

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Need help creating Macro that tracks inventory

    Replace this line of code (2 occurrences):
    Please Login or Register  to view this content.
    with this line:
    Please Login or Register  to view this content.
    The minus sign changed to a plus sign.

  7. #7
    Forum Contributor
    Join Date
    02-18-2020
    Location
    Ottawa, ON
    MS-Off Ver
    Professional Plus 2010
    Posts
    122

    Re: Need help creating Macro that tracks inventory

    Perfect. Thanks again!!

  8. #8
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Need help creating Macro that tracks inventory

    You are very welcome.

+ 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] Macro which tracks when an email attachment has been open
    By vba1234 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-01-2018, 10:38 AM
  2. Modifying a Macro that Tracks Changes
    By leooclaws in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-09-2014, 12:19 PM
  3. Replies: 1
    Last Post: 02-12-2014, 02:56 PM
  4. Replies: 0
    Last Post: 02-12-2014, 02:11 PM
  5. Replies: 0
    Last Post: 07-06-2013, 12:59 PM
  6. I am trying to update a spreadsheet that tracks inventory from data added to work order sh
    By MichelleSwanson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-25-2013, 07:48 AM
  7. Need help creating macro for Inventory
    By zachm85 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-30-2012, 06:52 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