1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Converting custom date format into text

Discussion in 'Business Applications' started by FernJones, Feb 28, 2015.

Thread Status:
Not open for further replies.
Advertisement
  1. FernJones

    FernJones Thread Starter

    Joined:
    May 30, 2011
    Messages:
    28
    First Name:
    Fern
    Hello,


    I have a column of dates that I have formatted like this:
    \S\Ayymmdd


    The date needs to look like this:
    SA160327


    This is exactly what I need, except I have to insert these in a csv file, and when I try to copy and paste the date, the formatting is gone, and I just get numbers like this:
    42456


    Does anyone know how I could copy my dates so that they're just text but in that format?
    I'm currently retyping all of them, and I have hundreds....


    Any help is much appreciated. Thanks in advance.
    Fern.
     
  2. Keebellah

    Keebellah Trusted Advisor

    Joined:
    Mar 27, 2008
    Messages:
    6,608
    First Name:
    Hans
    If it is Excel you're using then try the following
    Create a Costom Date format for these cells: : SAyymmdd

    With VBA a macro for those cells

    Dim cell as Range
    For Each cell in Rangë"D:D")
    cell.NumberFormat = "SAyymmdd"
    Next cell
     
  3. DaveBurnett

    DaveBurnett Account Closed

    Joined:
    Nov 11, 2002
    Messages:
    12,970
    Just to expand on that, the default date format in Excel is just the number of days since 1st Jan 1980.
     
  4. Keebellah

    Keebellah Trusted Advisor

    Joined:
    Mar 27, 2008
    Messages:
    6,608
    First Name:
    Hans
    Hi Dave, I don't think that is what the poster means, he is just telling us how the date is displayed and yes, that is the Nr of days since 1980.
     
  5. DaveBurnett

    DaveBurnett Account Closed

    Joined:
    Nov 11, 2002
    Messages:
    12,970
    FernJones: You need to look up using the string and char functions I think
     
  6. Keebellah

    Keebellah Trusted Advisor

    Joined:
    Mar 27, 2008
    Messages:
    6,608
    First Name:
    Hans
    Here's a sample
     

    Attached Files:

  7. FernJones

    FernJones Thread Starter

    Joined:
    May 30, 2011
    Messages:
    28
    First Name:
    Fern
    Hi,
    Thank you so much for all the replies, I really appreciate your help and time.
    My file worked great now!
    All the best,
    Fern.
     
  8. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1143959

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice