+ Reply to Thread
Results 1 to 8 of 8

Auto change date formats

  1. #1
    Registered User
    Join Date
    02-01-2016
    Location
    Manchester, England
    MS-Off Ver
    2010
    Posts
    3

    Auto change date formats

    Hi all, I have a stock file that I want to change the format of the date based on a reference. I have a database on one tab with the stock codes and number of other related references and a second tab with a form.

    The form is created by looking up the stock code and pulling through relevant information (mainly using INDEX, MATCH). It has a field to calculate the best before date by taking today's date (on the form) + the number of shelf life days (entered into a specific field) +90, +120 etc.

    However, I want it to then format it based on a chosen format for that stock code.

    Date code formats notes


    1. DD/MM/YY
    2. DD/MM/YYYY
    3. DD.MMM
    4. DD/MMM/YY
    5. DD/MMM/YYYY
    6. MM/DD/YY
    7. MM/DD/YYYY
    8. YY/MM/DD Month is: JA,FE, MR, AL, MA, JN, JL, AU, SE, OC, NO, DE
    9. ddd Julian code (day of the year)


    Is there away that I can give each stock code on the other tab a specific format? So that it calculates the best before date and changes the format to the specific format required?

    Many thanks
    Ben
    Last edited by Bernerd Ern; 02-02-2016 at 06:41 AM.

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Auto change date formats

    I don't have a solution , just a comment...

    Why would you want to use all those different date formats? Seems like it would just add confusion.

    1. DD/MM/YY
    6. MM/DD/YY

    If the entered date was 03/12/15 how would you know whether it was Mar 12 2015 or Dec 3 2015?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Auto change date formats

    yes, it is

  4. #4
    Registered User
    Join Date
    02-01-2016
    Location
    Manchester, England
    MS-Off Ver
    2010
    Posts
    3

    Re: Auto change date formats

    Hi, the date is printed on labels which are applied to products in the customer specific format. Having the form in the same format will allow it to be easily checked....hope that makes sense.

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Auto change date formats

    OK, makes sense.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Auto change date formats

    If there is some kind of identification value that corresponds to a specific format then you could use conditional formatting to do this provided you're using Excel 2010 or later. For example...

    Customer1 would use date format DD/MM/YY
    Customer2 would use date format DD/MM/YYYY
    Customer3 would use date format DD.MMM
    etc
    etc

    We'd have to do something different for formats 8 and 9 but that should be doable.

  7. #7
    Registered User
    Join Date
    02-01-2016
    Location
    Manchester, England
    MS-Off Ver
    2010
    Posts
    3

    Re: Auto change date formats

    Hi, I did see somewhere that conditional formatting may do it, but struggled to get it to work.

    I've attached an example file. If you think it's possible could you do it on such a file?

    Also, to be extremely cheeky - I've now been asked to include images, which again seems to be beyond me although I know it is possible - I've also included in the attached example. I can post as a new thread if required.

    Thank you guru's!
    Attached Files Attached Files

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Auto change date formats

    Sorry, I can't download your file. I have file size restrictions. Can't download anything >10kb.

+ 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. Change all date formats in a column at once?
    By jahagafut in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-13-2015, 11:52 AM
  2. VBA:comboboxes to present same date in different formats...ADAPT WITH CHANGE IN DATE
    By AlexDobbin in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-13-2015, 08:30 PM
  3. Date Formats Change inexplicably
    By yankiwibill in forum Excel General
    Replies: 0
    Last Post: 11-26-2014, 09:57 AM
  4. [SOLVED] User Form Tect Box Auto-Formats Text to Date
    By jewelsharma in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-09-2014, 08:42 PM
  5. Change date formats using a macro 01.23.11
    By SAP_hostage in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-31-2011, 04:17 PM
  6. How to change multiple date formats in same column
    By muchado in forum Excel General
    Replies: 6
    Last Post: 11-10-2010, 01:37 AM
  7. How to Change Date Formats
    By Jessica in forum Excel General
    Replies: 2
    Last Post: 11-01-2005, 04:09 PM

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