+ Reply to Thread
Results 1 to 5 of 5

Prompt user to enter date, then validate date, then continue with macro

  1. #1
    Registered User
    Join Date
    12-18-2014
    Location
    nyc
    MS-Off Ver
    2013
    Posts
    30

    Prompt user to enter date, then validate date, then continue with macro

    Hi- I wrote a macro, and need help with making a prompt. I need to do the following:

    1. Prompt the user to enter a date in mm/dd/yyyy format... this date also needs to be a Saturday
    2. If they enter the correct information, I want to continue the rest of the macro
    3. if the user enters anything other than a Saturday date in the correct format, i need a loop prompt telling them to re-enter the correct information. I need this message to come up until they enter the correct information
    3a. if they click cancel, I need to stop/exit the macro

    Any help would be great. I cannot seem to figure out the loop or the If statements.

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

    Re: Prompt user to enter date, then validate date, then continue with macro

    Maybe:

    Please Login or Register  to view this content.
    Last edited by JOHN H. DAVIS; 12-18-2014 at 04:22 PM.

  3. #3
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,829

    Re: Prompt user to enter date, then validate date, then continue with macro

    Please Login or Register  to view this content.
    If someone has helped you then please add to their Reputation

  4. #4
    Registered User
    Join Date
    12-18-2014
    Location
    nyc
    MS-Off Ver
    2013
    Posts
    30

    Re: Prompt user to enter date, then validate date, then continue with macro

    Thanks John much appreciated- the Macro works well- only a couple things:

    1. If i type a word, like "hello" in the prompt box, it gives me a runtime error, rather than prompting me to re-enter a date
    2. i need to take the correct date and enter that date into cell I9

    for validation for #1., would this work?:

    dte = InputBox("Please Enter Week Ending Date (mm/dd/yyyy): ", Default:=Format(Now, "mm/dd/yyyy"))

    Sheets("WH-347- Front").Range("I9").Value = dte

  5. #5
    Registered User
    Join Date
    12-18-2014
    Location
    nyc
    MS-Off Ver
    2013
    Posts
    30

    Re: Prompt user to enter date, then validate date, then continue with macro

    Thanks PJ... very simplistic and i like it... same issues as John though:

    1. if you type in a word, it gives me a runtime error.
    2. I need to take the correct date and put it into cell I9. See what i currently have in my post above

+ 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] 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
  2. [SOLVED] Macro to prompt user to select date and save file
    By TheLittlePrince in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-04-2013, 08:34 AM
  3. Trying to create a prompt where users must enter a date
    By IMacGill in forum Excel General
    Replies: 6
    Last Post: 04-17-2012, 01:51 PM
  4. Macro to Prompt User for Date Range when Opening Spreadsheet
    By Goofy_1969 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-23-2011, 11:50 AM
  5. Prompt user for date range upon startup
    By wyatt994 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-22-2011, 04:06 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