Checking For Expired Dates In A Range

  • Hi


    I currently have some code which checks the dates in a range when the workbook first opens.


    If the date in the range matches the current date or is older than the current date then I'd like a Userform to popup warning the user that something has expired.


    I'd like to add sometimes that some of the cells in the range may be blank.


    Currently the Userform pops up regardless :(


    I hope someone can help :)


    Here's what I currently have ..... Thanks


  • Re: Checking For Expired Dates In A Range


    stickyfeet,


    Try converting the cell value to a date:


    Code
    If CDate(ACell.Value) = Date Then


    If you get an error doing this, then you may need to reformat it in to something that looks like a date.


    G.

  • Re: Checking For Expired Dates In A Range


    stickyfeet,



    Try this. If a empty cell is encountered it will not product the userform.


    CharlesH


    There are other ways to do this, this is but 1!

  • Re: Checking For Expired Dates In A Range


    Thanks Charles,


    I just changed it to the following before I had a chance to read your post. Which also seems to work.


    I'll try your way and stick with that (as you can tell by my code, I'm not a coder)


    :)


    Thanks for your help.


    Regards


  • Re: Checking For Expired Dates In A Range


    I think you want this

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!