+ Reply to Thread
Results 1 to 12 of 12

Creating a report of expired stock

  1. #1
    Registered User
    Join Date
    04-06-2020
    Location
    New Zealand
    MS-Off Ver
    Professional Plus 2013
    Posts
    6

    Creating a report of expired stock

    Good evening all,

    New member today looking for help with my excel question.
    I have a work book with several tabs with medical supplies. Each page will have NIIN numbers, description of the item, how many, unit of Measure (UOM) and expiry date.
    What I am after is that when the items expire or about to expire indicated my conditional formatting, that I run a macro and can spit out the items across the spreadsheets that requires ordering.

    I wish the report to have the NIIN, Description, quantity and UOM so that i can just copy and paste it directly into an order form.

    I hope this all makes sense. have uploaded a mock workbook so you can see.

    Thanks in advance!
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: Creating a report of expired stock

    Hello Denja,

    Try the following:-

    Please Login or Register  to view this content.
    I'm assuming that the ARK 1 sheet is the summary sheet. The code allows for anything expired from the current date and due to expire from the current date plus seven days.

    I've attached your sample with the code implemented. Click on the "RUN" button to see how it works. For the sake of the exercise, I've also allowed for the dates to be transferred over as well just to show you more clearly how the code works.

    Test it in a copy of your actual workbook first.

    I hope that this helps.

    Cheerio,
    vcoolio.
    Attached Files Attached Files
    Last edited by vcoolio; 04-08-2020 at 01:48 AM.

  3. #3
    Registered User
    Join Date
    04-06-2020
    Location
    New Zealand
    MS-Off Ver
    Professional Plus 2013
    Posts
    6

    Re: Creating a report of expired stock

    Hi vcoolio,
    Thanks for quick reply.
    ARK 1 is another type of medkit rather than a summary sheet. Ideally it inputs it on a new sheet.
    I love how it works though!

  4. #4
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: Creating a report of expired stock

    Hello Denja,

    Ah, I see. We're on the right track at least.

    Create a "Summary" sheet in your workbook then, with the code, change this line:-

    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.
    (or whatever you'd like to call it)

    and change this line:-

    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.
    then assign the amended code to the button and all should work as you would like.

    I hope that this helps.


    Cheerio,
    vcoolio.

  5. #5
    Registered User
    Join Date
    04-06-2020
    Location
    New Zealand
    MS-Off Ver
    Professional Plus 2013
    Posts
    6

    Re: Creating a report of expired stock

    Hi again vcoolio,

    I have tried to do what you said, but in the process have stuffed something up.
    I've attached a more accurate representation of my spreadsheet; however on my actual one, i have a fair few more tabs.
    Hopefully if i get one tab working, the rest should be easy!

    Thanks again for your help!
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: Creating a report of expired stock

    Hello Denja,

    If you are getting an "Autofilter" error message in the second sample you have supplied, its because of the empty sheet. Delete the empty sheet.

    Next, remove the sort line of code:-

    Please Login or Register  to view this content.
    It wasn't really necessary.

    Hence the amended code should look like this:-

    Please Login or Register  to view this content.
    Another way around the empty sheet problem (assuming you don't want to delete it) is to add a little more to the code as follows:-

    Please Login or Register  to view this content.
    The additional bits in red font should prevent any error messages due to empty worksheets.

    BTW, the code won't return anything to the "Demand" sheet in the second sample as there aren't any expired dates or shortly to expire dates.

    I hope that this helps.

    Cheerio,
    vcoolio.

  7. #7
    Registered User
    Join Date
    04-06-2020
    Location
    New Zealand
    MS-Off Ver
    Professional Plus 2013
    Posts
    6

    Re: Creating a report of expired stock

    Thanks alot! Works just like I want it to! One small glitch is that the macro doesn't want to work on the last 2 sheets even though they are formatted exactly the same.
    If i copy an expired item over from another sheet, the macro will work only on that one item and not the rest of the sheet.
    Is there an easy fix?

  8. #8
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: Creating a report of expired stock

    I'm not sure what would be causing that.
    Could you please upload the sample again in full this time. That'll be the easiest way to try and sort it out for you.

    Cheerio,
    vcoolio.

  9. #9
    Registered User
    Join Date
    04-06-2020
    Location
    New Zealand
    MS-Off Ver
    Professional Plus 2013
    Posts
    6

    Re: Creating a report of expired stock

    Hi Vcoolio,

    Here is the entire document. Thanks for looking at it. I cant for the life of me get my head around why is isnt working.

    Cheers
    Attached Files Attached Files

  10. #10
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: Creating a report of expired stock

    Hello Denja,

    The reason that you're having that problem is because your worksheets are not set out in a uniform manner so the autofilter cannot distinguish where its supposed to be filtering from on the different worksheets.

    Autofilter is an important and efficient tool when there are multiple worksheets as source sheets, especially those with large data sets and will make data transfer seamless. However, one needs to work on its terms and it also requires headings to function correctly (one worksheet does not have headings at all). Order is important with data bases.

    Can you please re-format your worksheets uniformly with the headings:-

    NIIN Drug QTY UOM Expiry Date # Resupply


    placed in Row1 of each source worksheet then upload the modified version of your workbook again.

    Cheerio,
    vcoolio.
    Last edited by vcoolio; 04-09-2020 at 02:50 AM. Reason: Additional info.

  11. #11
    Registered User
    Join Date
    04-06-2020
    Location
    New Zealand
    MS-Off Ver
    Professional Plus 2013
    Posts
    6

    Re: Creating a report of expired stock

    Just did those changes and boom it works! Thanks again for your help Vcoolio!

  12. #12
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: Creating a report of expired stock

    You're welcome Denja. I'm glad that I was able to help.

    Cheerio,
    vcoolio.

+ 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] creating a stock list - need to know how much material i have in stock
    By AleksBabic in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-27-2016, 07:10 AM
  2. Stock Report
    By aniesh in forum Excel General
    Replies: 1
    Last Post: 01-31-2016, 03:09 AM
  3. Stock Report
    By aniesh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-31-2016, 03:08 AM
  4. Replies: 0
    Last Post: 07-27-2015, 01:06 PM
  5. [SOLVED] Stock report branchwise , need to view my way
    By makinmomb in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-09-2014, 08:25 AM
  6. Report stock movement report in excel 2007
    By sattarsiddiqui123 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-12-2014, 05:35 AM
  7. finalize to my stock report.
    By johncena in forum Excel General
    Replies: 1
    Last Post: 11-28-2010, 09:25 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