+ Reply to Thread
Results 1 to 5 of 5

Retain date format for input entered as date

Hybrid View

  1. #1
    Registered User
    Join Date
    03-10-2014
    Location
    Mumbai
    MS-Off Ver
    Excel 2010
    Posts
    27

    Retain date format for input entered as date

    Hi all,

    I'm using nested SUBSTITUTE formula to make some changes to the some of the data. I'm also using IFERROR to return the input if it does not find the criteria I have specified. I have lot of variations in my input data.

    The formula works fine for all except for date format input.

    Sample:

    N90232Y09--->SUBSTITUTE(A1,"N","")-->90232Y09
    12335--->12335
    12/3/1923---->58936 (I want the date to be retained)

    Can somebody help me out on this and also let me know why the date format is changed even if don't specify any changes for it. I expect my IFERROR to just retain the input as it is.

    Thanks,

    Chippi

  2. #2
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Usually at work, in the UK
    MS-Off Ver
    Excel 2010
    Posts
    640

    Re: Retain date format for input entered as date

    Try setting the date format at the start of your code.

    Change the xxxx for wherever the text is (i.e. my data was in Userform1.Label1.Text = Format(Userform1.Label1.Text, "d mmmm yyyy") This gives me 9 Mar 2014.

    xxxx.Text = Format(xxxx.Text, "dd mmm yyyy")

  3. #3
    Registered User
    Join Date
    03-10-2014
    Location
    Mumbai
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Retain date format for input entered as date

    Hi ScOttle,

    Can you suggest me another method as I'm not using Vb.

    Thanks,
    Chippi

  4. #4
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Usually at work, in the UK
    MS-Off Ver
    Excel 2010
    Posts
    640

    Re: Retain date format for input entered as date

    Apologies, I thought this was the VB forum

  5. #5
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Retain date format for input entered as date

    Pl see attached file.
    Attached Files Attached Files

+ 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: 5
    Last Post: 11-11-2013, 11:15 AM
  3. Replies: 0
    Last Post: 05-25-2009, 06:58 PM
  4. How to retain date format when using ActiveCell.Offset().Value
    By ST4RCUTTER in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-07-2007, 04:44 PM
  5. [SOLVED] Retain date format in cell
    By Jan 2HW in forum Excel General
    Replies: 1
    Last Post: 08-09-2006, 02:34 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