+ Reply to Thread
Results 1 to 4 of 4

Clear userform if expiry date exceeds Today

  1. #1
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Clear userform if expiry date exceeds Today

    Hi, attached is a file that we use to generate labels for our reagents. After selecting a reagent and the lot number, an expiry date is populated based on the data in the "Expiry" tab. What I hope to achieve is to have a popup msg appear when a user selects an expired chemical and the userform will clear so that the user can start again. Have tried some methods including addition of a textbox that shows today's date, but seems like im not getting it right.The textbox showing today's date can be removed if it is not required.
    Last edited by bqheng; 11-05-2015 at 09:14 PM.

  2. #2
    Forum Contributor Obsessed's Avatar
    Join Date
    05-22-2013
    Location
    Cincinnati, Ohio
    MS-Off Ver
    Excel 365
    Posts
    215

    Re: Clear userform if expiry date exceeds Today

    Here you go...just modified your cboLot event handler:

    Please Login or Register  to view this content.
    Want to show appreciation for the help you received from a member? Give them reps by clicking the bottom left of their post!

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Clear userform if expiry date exceeds Today

    You may want to consider checking the expiry date when populating the Lot combobox and just omitting expired lots.

    Please Login or Register  to view this content.
    You could also test the date when populating the
    Last edited by AlphaFrog; 11-04-2015 at 10:16 PM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: Clear userform if expiry date exceeds Today

    Thank you both for your suggestions. Have opted for AlphaFrog's code and tweaked it to disable the commandbutton

+ 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] Clear multiple cells when a dropdown is changed and reset to today's date
    By GregHorn27 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-20-2015, 10:37 AM
  2. autocalculate expiry date / expiry date colour warnings
    By kimbling1 in forum Excel General
    Replies: 8
    Last Post: 08-27-2014, 02:53 AM
  3. [SOLVED] Prefill text box in userform with today's date but allow user to enter unique date
    By moosetales in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-02-2014, 09:17 AM
  4. [SOLVED] Listbox in userform to populate with all rows containing the Date today AND 2 weeks prior
    By cath1509 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-05-2013, 08:50 PM
  5. Userform: Calender to open with today's date as default
    By Ashali in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-11-2012, 07:01 AM
  6. Clear cell based on expiry date in another cell
    By hezcal11 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-11-2011, 12:01 PM
  7. Cmdbutton to add today's date in a userform
    By Dave12345 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-22-2010, 01:34 PM

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