+ Reply to Thread
Results 1 to 10 of 10

Track expired items in separate sheet

  1. #1
    Registered User
    Join Date
    09-19-2012
    Location
    ny
    MS-Off Ver
    Excel 2007
    Posts
    5

    Track expired items in separate sheet

    Hi,
    New member here, just starting to figure out the wonders of excel and hoping someone can help me. I am trying to track medications stocked on our ambulances. We have 7 ambulances each is a separate sheet. The list of medication names is column A, and the expiration dates are listed in columns B-I (as we carry up to 8 vials of any given item). I already have the conditional formatting set up to highlight different colors 30 days prior, 14 days prior etc. in each sheet, I would like to create a separate sheet that will list items expiring in next 14 days and their location (basically, the sheet name). Not sure how to go about doing this. I am also unfamiliar with any other kinds of 'code' other than formulas that are entered into the excel program.

    I am attaching the sheet I have set up so far,
    Thanks in advance for your help

    Expiration Dates.xlsx
    Last edited by ctgo4it; 09-20-2012 at 01:00 AM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Track expired items in separate sheet

    So which columns do you want displayed in the new sheet? Do you want it in the same format as your other sheets?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    09-19-2012
    Location
    ny
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Track expired items in separate sheet

    I'm not sure which is easier to accomplish. Either the sheet name should appear next to the corresponding medication name when a medication is expired, or maybe have top row of sheet names and have the expired medication appear below? Are there any other possibilities/ideas?

    Thanks!

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Track expired items in separate sheet

    You do not require the dates to be displayed?

  5. #5
    Registered User
    Join Date
    09-19-2012
    Location
    ny
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Track expired items in separate sheet

    I don't necessarily need the dates, just the med name and location. I would like the color to correspend to the dates meaning it turns red 14 days before, orange 30 days. I'm open to other ideas,

    Thanks for the quick replies

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Track expired items in separate sheet

    Try this code
    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose View | Macros
    Select a macro in the list, and click the Run button

    The output gives multiple rows for the same medicine if it finds more than 1 vial having the same date <= 14 days. Let me know if you need a code to remove the duplicate values.

  7. #7
    Registered User
    Join Date
    09-19-2012
    Location
    ny
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Track expired items in separate sheet

    This is so cool! Thanks
    2 questions:
    1- should it refresh every time something is changed or entered? Right now when I enter a date on one of the other sheets, it's not showing up in 'report'. Am I not doing something correctly?
    2- Is it possible to make the name or location show up in color so I can differentiate between 14 days and 30 days?

    Thanks tons!

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Track expired items in separate sheet

    1- should it refresh every time something is changed or entered? Right now when I enter a date on one of the other sheets, it's not showing up in 'report'. Am I not doing something correctly?
    Each time something is entered, you will need to re-run the macro. However, that can result in duplications. I will provide you the updated code which will clear the output sheet and then give you the details afresh without duplications.
    2- Is it possible to make the name or location show up in color so I can differentiate between 14 days and 30 days?
    The code is only bringing out those which are expiring in 14 days, where do the 30 days entries feature?

  9. #9
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Track expired items in separate sheet

    Updated code to avoid duplications-
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    09-19-2012
    Location
    ny
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Track expired items in separate sheet

    Quote Originally Posted by arlu1201 View Post
    The code is only bringing out those which are expiring in 14 days, where do the 30 days entries feature?
    The 30 day entries turn orange, but I don't need to add it, I was just wondering if it was in the report which I see it isn't.
    The only other thing I would really like is to have the name of the medication change to red when the expiration date has passed, so I can differentiate between expirING and expirED

    Other than that, this is exactly what I was looking for!
    Thanks a ton

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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