+ Reply to Thread
Results 1 to 10 of 10

VBA to convert date value to another format of date

  1. #1
    Forum Contributor
    Join Date
    07-17-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    715

    VBA to convert date value to another format of date

    Hi,

    I have column with below date value in it.

    Please Login or Register  to view this content.
    I need VBA which will convert the value to 6/18/2014 1:44:13 PM in cell.

    Please assist.

    Thanks,
    Shiva
    Keep the Forum clean :


    1. Use [ code ] code tags [ /code ]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    2. Show appreciation to those who have helped you by clicking * Add Reputation below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

  2. #2
    Forum Contributor
    Join Date
    07-17-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    715

    Re: VBA to convert date value to another format of date

    Please Login or Register  to view this content.
    I tried this one, But it changes the date to 6/18/2014 12:00:00 AM

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA to convert date value to another format of date

    Shiva,
    I have not looked at your code, but this gives the right format. I have tried it on range("A17") and converted in B17.

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    07-17-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    715

    Re: VBA to convert date value to another format of date

    It works well..But how to make it run on every cell?

    Thanks,
    Shiva

  5. #5
    Forum Contributor
    Join Date
    07-17-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    715

    Re: VBA to convert date value to another format of date

    Like Entire A column to B column?

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA to convert date value to another format of date

    Where is the data? Which column? If the data are in Jun-18-2014 01:44:13 PM format, you just need to
    loop through each cell and convert them in proper format.

  7. #7
    Forum Contributor
    Join Date
    07-17-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    715

    Re: VBA to convert date value to another format of date

    Column A

    Jun-18-2014 04:24:57 PM
    Jun-10-2014 06:58:33 AM
    Jun-06-2014 10:20:47 AM
    Jul-02-2014 12:19:19 PM
    Jul-01-2014 10:49:19 AM
    Jun-10-2014 02:38:33 AM
    Jun-18-2014 12:10:32 PM
    Jun-20-2014 12:48:55 PM
    Jun-23-2014 12:07:41 PM
    Jun-27-2014 12:13:53 PM
    Jun-09-2014 04:30:22 PM
    Jun-11-2014 03:11:08 PM

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA to convert date value to another format of date

    If it is column A ONLY, remove the second line.

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    07-17-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    715

    Re: VBA to convert date value to another format of date

    Thanks for the code AB. Works perfect.

    Thanks,
    Shiva

  10. #10
    Forum Contributor
    Join Date
    07-17-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    715

    Re: VBA to convert date value to another format of date

    Thanks a lot.. Both code works perfect.

    Note: Please ignore.. Accidental type through Android App.

+ 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] How to convert exported text date to desired date format with excel vba.
    By sktneer in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 10-03-2013, 01:08 AM
  2. Cannot convert date (which is in text format) to date in numeric format
    By geniuspro in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 10-19-2012, 09:21 AM
  3. Need Formula/VBA Code to convert date in String Format to Normal Date format
    By Karthik Sen in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-18-2012, 04:54 AM
  4. Formula to convert text to a date in a date format
    By mikeburg in forum Excel General
    Replies: 5
    Last Post: 08-24-2011, 09:15 AM
  5. Replies: 1
    Last Post: 02-10-2005, 06:06 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