+ Reply to Thread
Results 1 to 10 of 10

Date formatting

  1. #1
    Registered User
    Join Date
    04-10-2014
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    39

    Date formatting

    I hope this is an easy one.

    I have a macro that is passing a date like this:

    6/24/2014 1:52:00 PM

    I've been trying unsuccessfully to change the format to:

    Tue, 6/24/2014 1:52 PM

    And have it display that way in the excel cell.

    Thank you for your help!

  2. #2
    Forum Contributor
    Join Date
    06-28-2004
    MS-Off Ver
    Home/Office 2016
    Posts
    246

    Re: Date formatting

    =TEXT(LEFT(A1, SEARCH(" ",A1,1)),"ddd")&","&A1
    see if this works....

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: Date formatting

    Sorry but using text will convert he date to - text. It will no longer be (easily) usable in calcs. Rather change the formatting to Custom ddd, m/d/yyyy h:mm AM/PM This will maintain the date as a date and still give you the appearance you want
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Thumbs up Re: Date formatting

    Hey bro,
    I have solved it..
    I have used custom format... in the format cell option in the right click menu....

    Check the attachment..



    Say thanks, Click *
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-10-2014
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Date formatting

    Quote Originally Posted by FDibbins View Post
    Sorry but using text will convert he date to - text. It will no longer be (easily) usable in calcs. Rather change the formatting to Custom ddd, m/d/yyyy h:mm AM/PM This will maintain the date as a date and still give you the appearance you want
    To be honest, if it comes out as text or a Date I wont mind. As long as its formatted to match my example.
    Thank you for your comments. I should have been clearer.

  6. #6
    Registered User
    Join Date
    04-10-2014
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Date formatting

    Quote Originally Posted by Vikas_Gautam View Post
    Hey bro,
    I have solved it..
    I have used custom format... in the format cell option in the right click menu....

    Check the attachment..



    Say thanks, Click *
    Thanks for your help, Unfortunately that didn't do it. The dates that will be passed may not be the current date.
    Also I need this to work in my macro.

  7. #7
    Registered User
    Join Date
    04-10-2014
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Date formatting

    Quote Originally Posted by x65140 View Post
    =TEXT(LEFT(A1, SEARCH(" ",A1,1)),"ddd")&","&A1
    see if this works....
    Sorry that didn't work.

  8. #8
    Registered User
    Join Date
    04-10-2014
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Date formatting

    I figured it out!!!
    Here is the code.
    Please Login or Register  to view this content.
    Thank you all for your help. Reading your comments sent me in the right direction!

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: Date formatting

    Did you read the last part of my post?

    Rather change the formatting to Custom ddd, m/d/yyyy h:mm AM/PM This will maintain the date as a date and still give you the appearance you want
    No VBA, no formula needed

  10. #10
    Registered User
    Join Date
    04-10-2014
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Date formatting

    Quote Originally Posted by FDibbins View Post
    Did you read the last part of my post?



    No VBA, no formula needed
    Yes I did and thank you. The reason I'm using VBA, is because I'm doing a bunch of calculations and part of the output is dates creation.
    Thank you again for all your help!

+ 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. Replies: 3
    Last Post: 11-23-2013, 06:21 AM
  2. Replies: 2
    Last Post: 09-19-2013, 10:34 AM
  3. Replies: 5
    Last Post: 08-22-2012, 05:06 PM
  4. Replies: 3
    Last Post: 07-11-2012, 10:03 AM
  5. Replies: 3
    Last Post: 08-18-2010, 12:58 PM

Tags for this Thread

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