+ Reply to Thread
Results 1 to 6 of 6

Need VBA code to change date format inside cell

  1. #1
    Forum Contributor
    Join Date
    07-21-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007,2010,2016
    Posts
    695

    Need VBA code to change date format inside cell

    Hi Experts

    I have issue in date format where formula not support

    column A:A entired colu
    29/03/2021 i want change as 03/29/2021
    30/09/2022 i want change as 09/30/2022
    30/04/2021 i want change as 04/30/2021
    28/04/2021 i want change as 04/28/2021
    14/04/2021 i want change as 04/14/2021
    21/03/2023 i want change as 03/21/2023
    21/03/2023 i want change as 03/21/2023


    03-Jun-20 look like this

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,641

    Re: Need VBA code to change date format inside cell

    Do you still need VBA if formula can do it?
    Are dates real date, or text string?
    Have you tried to format column A as "mm/dd/yyyy"?
    If yes, and if format does not changed, try in B1:
    =DATE(RIGHT(A1,4)+0,MID(A1,4,2)+0,LEFT(A4,2)+0)
    Drag down then copy column B, then paste value back to column A, then format again.
    If it still does not work, try to attach a sample worksheet.
    Quang PT

  3. #3
    Forum Contributor
    Join Date
    07-21-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007,2010,2016
    Posts
    695

    Re: Need VBA code to change date format inside cell

    Hi boss

    its work when change manually if i use formula it give some
    28/10/2019 09:00:00 if i use formula come like this 10/28/1900

  4. #4
    Forum Contributor
    Join Date
    07-21-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007,2010,2016
    Posts
    695

    Re: Need VBA code to change date format inside cell

    i have date like this 28/10/2019 09:00:00
    21/10/2022 17:02:31
    14/01/2020 10:47:02
    24/04/2023 18:00:00
    18/05/2020 16:54:05
    26/03/2019 15:37:21
    18/10/2022 10:59:28

    want to change as cell look like that 28-Oct-19 but inside 10/28/2019 9:00:00 AM
    Last edited by breadwinner; 03-02-2023 at 12:34 AM.

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,641

    Re: Need VBA code to change date format inside cell

    Pls attach a sample worksheet.

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

    Re: Need VBA code to change date format inside cell

    Try this formula in B1 copied down

    =DATE(MID(A1,7,4)+0,MID(A1,4,2)+0,LEFT(A1,2)+0)+(Right(A1,8)+0)
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

+ 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. [SOLVED] Convert date text inside a cell into DATE() type inside a function
    By xChristy in forum Excel General
    Replies: 4
    Last Post: 06-04-2020, 09:44 AM
  2. change date format in VBA code it means change output when printing cheque
    By keshavtale in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-23-2019, 06:06 AM
  3. [SOLVED] Change the order of the date inside a cell
    By egotajcs in forum Excel General
    Replies: 5
    Last Post: 10-17-2016, 06:03 AM
  4. Need vba code to change date&time stamp as date format dd-mmm-yy in A:A rng
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-03-2014, 06:08 AM
  5. [SOLVED] help on vba code to change the error date format as standard format mm/dd/yyyy
    By johnodys in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-13-2013, 01:10 AM
  6. Replies: 1
    Last Post: 05-10-2012, 11:51 PM
  7. Change date format inside rename formula
    By BLopes in forum Excel General
    Replies: 2
    Last Post: 06-23-2010, 10:44 AM

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