+ Reply to Thread
Results 1 to 3 of 3

Input Box On Open (Date)

Hybrid View

  1. #1
    Registered User
    Join Date
    03-28-2007
    Posts
    25

    Cool Input Box On Open (Date)

    Hello

    I have this code to lanch an Input box when my spreadsheet opens, and it works fine:
      Sub Auto_open()
    x = InputBox("Please Enter Reporting Date (DD/MM/YYYY)", "deposit calc", vbOKCancel)
    Sheets("INPUT").Range("c2") = x
    End Sub

    Is there a way that I can configure the input box to only allow the user to input a DATE, in the format DD/MM/YYYY?

    Many thanks

    James
    Last edited by VBA Noob; 06-28-2007 at 08:09 AM.

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Please read forum rules & wrap your VBA code

    See blue link below for rules
    See Red link below for Wrapping instructions

    If you do not understand the VBA code wrap instructions have a look at my last reply in this thread
    http://www.excelforum.com/showthread.php?t=583950
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    see the Excel VBA Help for types of restrictions on InputBoxes, unfortunately Dates aren't included.

    Also, Auto_open macros have been superceded by the Worksheet_Open event of the Workbook object - see

    http://www.excel-it.com/Forum/viewtopic.php?t=11
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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