Results 1 to 7 of 7

Checking Date in Macro Code

Threaded View

  1. #1
    Registered User
    Join Date
    06-09-2009
    Location
    San Antonio, TX
    MS-Off Ver
    Excel 2003
    Posts
    2

    Smile Checking Date in Macro Code

    I have a spreadsheet that I created that we use as our Invoice. I have created a macro button that does certain checks/balances when it is pressed, after the invoice has been created. One of the common problems was that the employees would forget to put a date on the invoice. So now, I have the code for that:
    If Range("D5").Value = "" Then
         Range("D5").Select
         If MsgBox("You Forgot to Enter Date!", vbCritical) = vkOK Then Exit Sub
    End If
    But now, I want to go one step further. In addition to checking to see if there is somthing in the field, I want it to check to make sure that the date entered is TODAY and if it's not, to popup with a MSGBOX that says, "Are you sure you want to enter a date other than today?". If they enter yes, the code proceeds with the checking. If they enter No, I want the program to stop running and to go to that field D5 and wait for the user to correct the date. As a newbie, I'm just unclear what function to use. I've tried various things, all to no avail. Can anyone help me? Thank you!
    Last edited by mmwtx; 06-09-2009 at 05:10 PM. Reason: Added Code Tags

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