+ Reply to Thread
Results 1 to 3 of 3

Format Date in ActiveCell

  1. #1
    Registered User
    Join Date
    02-05-2013
    Location
    Maryland
    MS-Off Ver
    Excel 2013
    Posts
    13

    Format Date in ActiveCell

    Please don't laugh. I know to some of you this will be very basic. I have this code that I have managed to put together with the Macro Recorder and some other examples online. I want to format the date in the ActiveCell so that no matter what is entered it will always be in the form DD/MMM/YYYY


    Dim Ancestor_DOB As String

    ' ANCESTOR'S DOB
    Range("B3").Select
    Do Until Ancestor_DOB <> ""
    Ancestor_DOB = InputBox$("Enter your ancestors date of birth: ", "", "", 1300, 7400)
    If (Ancestor_DOB = "") Then
    Beep
    MsgBox "Please Enter Your Ancestore Date of Birth."
    Else

    ActiveCell = Format(DOB, dd / mm / yyy) ' My last feeble attempt was this, but it did not work
    End If
    Loop

    As you can tell I don't know what I am doing to much here. Can someone please help me get started? I think once I understand the basics of VB syntax I can move along.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,860

    Re: Format Date in ActiveCell

    Try this
    Please Login or Register  to view this content.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    818

    Re: Format Date in ActiveCell

    Something like this.

    Please Login or Register  to view this content.
    Kind regards, Harry.

+ 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