+ Reply to Thread
Results 1 to 6 of 6

Force user to fill date values in cells

  1. #1
    Forum Contributor
    Join Date
    08-19-2010
    Location
    N/A
    MS-Off Ver
    Excel 2010
    Posts
    151

    Force user to fill date values in cells

    Hello,

    I need to define validation rule to a range of cells.
    All cells should accept only DATE inputs
    in format "mm/dd/yy".

    I used VBA to set the format of a RANGE:

    rng.Select
    Selection.NumberFormat = "mm/dd/yy"

    but excel accept general string inputs etc.

    Can you help me ?

    Thank you
    Last edited by Snoopy2003; 09-03-2010 at 03:56 PM.

  2. #2
    Valued Forum Contributor blane245's Avatar
    Join Date
    02-20-2009
    Location
    Melbourne, FL
    MS-Off Ver
    Excel 2010
    Posts
    649

    Re: Force user to fill date values in cells

    Why not use the Data Validation.. menu item for the cells you want to constrain to date input?
    Bob
    Click my star if my answer helped you. Mark the thread as [SOLVED] if it has been.

  3. #3
    Forum Contributor
    Join Date
    08-19-2010
    Location
    N/A
    MS-Off Ver
    Excel 2010
    Posts
    151

    Re: Force user to fill date values in cells

    Hello,

    Thank you for your help.

    If I choose DATA->VALIDATION->DATE I need to set valuse for FROM DATE, TILL DATE.
    Is there any way to write this in VBA and check only if a DATE was filled in the cell ?
    I do not mind which date the user will fill in the cell. I just want it to be a date in the format mm/dd/yy.

    I hope you can help me.

    Thank you

  4. #4
    Forum Contributor
    Join Date
    07-16-2009
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2013
    Posts
    114

    Re: Force user to fill date values in cells

    Have you tried using data validation instead of a macro? you can force a date to be entered like that

    you can also do it through vba

    Please Login or Register  to view this content.
    Chris

  5. #5
    Valued Forum Contributor blane245's Avatar
    Join Date
    02-20-2009
    Location
    Melbourne, FL
    MS-Off Ver
    Excel 2010
    Posts
    649

    Re: Force user to fill date values in cells

    You could do all of your data validation in VBA, but you may want to let the Excel Data Validation help you out. You could set the from and to dates to very smal and very large dates so that they have little on no effect.

  6. #6
    Forum Contributor
    Join Date
    08-19-2010
    Location
    N/A
    MS-Off Ver
    Excel 2010
    Posts
    151

    Re: Force user to fill date values in cells

    Thank you for your help. You solved my problem.

+ Reply to Thread

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