+ Reply to Thread
Results 1 to 8 of 8

Time format changes after playing macro excel 2007

  1. #1
    Registered User
    Join Date
    12-10-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    6

    Time format changes after playing macro excel 2007

    Good Morning All

    I am hoping you can assist me with an issue I am having running a macro on Excel 2007.

    I have recorded a macro that involves splitting one cell containing date ddmmyyyy and time (24 hour) hh:mm:ss into two one with the date and one with the time.

    This is not an issue when I record it but when I run it using test data the time format goes to a 12 hour format and adds a cell containing AM or PM.

    I do not know why the time changes format. I have tried re recording the macro, clearing formats and also during the recording ensuring the time format is in the correct format. All to no avail, when I press play it goes to 12 hour format with the new AM or PM column.

    Am I missing something very simple? Please can somebody point me in the right direction.

    Many Thanks

    Stuart

  2. #2
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Time format changes after playing macro excel 2007

    Hi,

    Post you macro to see the issue and to suggest the remedy for the same.
    Happy Computing ,

    Xlbiznes.

    To show your appreciation please click *

  3. #3
    Registered User
    Join Date
    12-10-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Time format changes after playing macro excel 2007

    Hi

    Please see the macro that has been recorded.

    Many Thanks for your help.

    RAG Macro.txt

  4. #4
    Registered User
    Join Date
    12-10-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Time format changes after playing macro excel 2007

    Hi

    Please see the macro that has been recorded.

    Attachment 283277

    Many Thanks for your help.

    Stuart

  5. #5
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Time format changes after playing macro excel 2007

    Hi,

    this is the line where you are setting the time format

    Please Login or Register  to view this content.
    change this to :
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    12-10-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Time format changes after playing macro excel 2007

    Thanks for that. I have just tried it and it still adds the additional column with the AM or PM in it.

    There has to be a way of stopping this.

    Thanks for looking into it.

  7. #7
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Time format changes after playing macro excel 2007

    Hi,

    check this code that i tried to simulate the output that you are trying to achieve.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    12-10-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Time format changes after playing macro excel 2007

    Hi

    I am posting an amended version of the data that I am trying to manipulate. I have only changed the server names but everything else is the same.

    I had a look at the macro that you wrote and it is slightly different than what I need. I really appreciate your input though.

    TEST DATA.txt

    Thanks

    Stuart

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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