+ Reply to Thread
Results 1 to 8 of 8

Date MsgBox

  1. #1
    Registered User
    Join Date
    01-12-2014
    Location
    .
    MS-Off Ver
    .
    Posts
    2

    Date MsgBox

    Hi,

    I have a column of dates in a worksheet. I would like to be able to have a MsgBox display if one of those dates is equal to today. I would also like another MsgBox to display if it has gone past a date in the range with a different message.

    I'm still learning the basics of VBA and i'm pretty sure I would need an IF statement but I have no idea how to write it!

    The sheet name is "Visas" and the range of dates is "F12:F31".

    If anyone could help, I'd be most grateful.

    Manfred

  2. #2
    Valued Forum Contributor adyteo's Avatar
    Join Date
    01-10-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    540

    Re: Date MsgBox

    For the first part, you can use the attached file.

    For the second part (past due) I am not sure I fully understand the request.
    Attachment 303575
    Click on the star if you think I helped you

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Date MsgBox

    Maybe:

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    02-24-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    317

    Re: Date MsgBox

    Somewhat very similar to John's code;
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    02-24-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    317

    Re: Date MsgBox

    Or this, if you want to show the date (rather than the cell reference) in the message box;
    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor adyteo's Avatar
    Join Date
    01-10-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    540

    Re: Date MsgBox

    I would suggest to exit the sub once a Msgbox is popped up to avoid a series of message boxes showing for each date. Maybe a summary at the end of how many dates are either past due or today.

  7. #7
    Registered User
    Join Date
    01-12-2014
    Location
    .
    MS-Off Ver
    .
    Posts
    2

    Re: Date MsgBox

    Wow!

    adyteo, John, Jim - Thanks very much, that's great! Works perfectly!

    I've got a lot of learning to do!

  8. #8
    Forum Contributor
    Join Date
    02-24-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    317

    Re: Date MsgBox

    Quote Originally Posted by adyteo View Post
    I would suggest to exit the sub once a Msgbox is popped up to avoid a series of message boxes showing for each date. Maybe a summary at the end of how many dates are either past due or today.
    In line with that idea, here's what is needed;
    Please Login or Register  to view this content.

+ 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. Help required with developing a error msgbox when end date is before start date
    By Graeme Smith in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-05-2013, 11:56 PM
  2. [SOLVED] msgbox if todays date is past date in cell
    By timtim89 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-21-2012, 07:08 PM
  3. [SOLVED] MsgBox date
    By IRMA MENDOSA in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-20-2006, 03:15 AM
  4. [SOLVED] Date Programming via a MSGBOX
    By GLT in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-14-2005, 01:50 PM
  5. MsgBox date & time
    By skippy in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-22-2005, 04:06 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