+ Reply to Thread
Results 1 to 13 of 13

Macro to enter a date without the "/" and convert it to a real date entry

  1. #1
    Registered User
    Join Date
    04-13-2010
    Location
    Illinois
    MS-Off Ver
    Excel 2003
    Posts
    22

    Macro to enter a date without the "/" and convert it to a real date entry

    I have 4 fields in my worksheet, all going to a formula that is working how i want it, but right now you have to input into those 4 fields the dates with "/" included (04/14/2010)

    I'd like for them to be able to enter 041410 and have it automatically change for them to 04/14/2010.

    Im new with macros but need to get this as soon as i can, any help would really rock.

    Just let me know if i need to do somethign in my options or anything else.

    thanks again
    Last edited by Argile79; 04-14-2010 at 05:12 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Macro to enter a date without the "/"

    Just entering as 4/14 would give the same result, with the cells formatted beforehand.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Macro to enter a date without the "/"

    Here is also a macro that might help....

    ... not sure if you caught my posting of it in your last thread:

    http://www.cpearson.com/excel/DateTimeEntry.htm
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Registered User
    Join Date
    04-13-2010
    Location
    Illinois
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Macro to enter a date without the "/"

    Yeah i saw that, thanks, but confused me :P was hopin for a simpler result...but if i don't get it figured out here at work, then i can go through that at home tonight and take my time and look into it, was hopin to figure somethin out before i go. Either way..you've been really helpful..hope my thanks is enough..

  5. #5
    Registered User
    Join Date
    04-13-2010
    Location
    Illinois
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Macro to enter a date without the "/"

    Also, shg, i tried just doing the 4/16...it does work, BUT if its in last years frame, it don't work, only doing 2010..


    But thanks..

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Macro to enter a date without the "/"

    4/14/9

    NBVC's suggestion of Chip Pearson's approach doesn't require anything more than copying the macro and adjusting the range.

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Macro to enter a date without the "/"

    That first macro in the link is easy to apply.

    Just right-click the sheettab and select View Code.

    Paste it in there and change the A1:A10 reference to G13:G16 (or whatever range)...

    When you return to the sheet and type in the date as 041410 it converts to 4/14/2010

    You can remove some of the CASE statements if you don't want to allow other variations of data entry.

  8. #8
    Registered User
    Join Date
    04-13-2010
    Location
    Illinois
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Macro to enter a date without the "/"

    Ok, i tried that site you linked and inputted the macro into my VBA to test it and either it didn't carry over right or im not doin something right, but its not doing anything for me..nothing is changing at all in boxes A1:A10

    Suggestions?

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Macro to enter a date without the "/"

    Post the workbook that doesn't work?

  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Macro to enter a date without the "/"

    Did you right click the sheettab name you are working in at the bottom of your workbook and then select View Code from the popup menu and then paste in the VB editor that comes up?

  11. #11
    Registered User
    Join Date
    04-13-2010
    Location
    Illinois
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Macro to enter a date without the "/"

    WOW..i did exactly that, seriously, but instead of right clicking and view code i went to macro visual basic and came to the same spot, but your way now it works, my way didn't do anything LOL

    Im done, thank you SOO much all you guys..appreciate it, now just need to do some cosmetic things.

    Again you all rock, thanks again

  12. #12
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Macro to enter a date without the "/"

    If you go your route, you have to ensure to select the proper sheet from the project explore within the workbook and then right-click >> View Code... you can't do Insert|Module

    also, please mark the thread as SOLVED.

  13. #13
    Registered User
    Join Date
    04-13-2010
    Location
    Illinois
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Macro to enter a date without the "/" and convert it to a real date entry

    you got it, thanks again..aprreciate everything. have a great night.

+ 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