+ Reply to Thread
Results 1 to 5 of 5

Excel Timestamp format editing

  1. #1
    Registered User
    Join Date
    08-06-2013
    Location
    boston
    MS-Off Ver
    Excel 2010
    Posts
    5

    Exclamation Excel Timestamp format editing

    Hello everyone,

    I have a external device that collects force data and saves directly to an .xls file with a timestamp for each data value. I am trying to create a Force vs. Time plot for my data set (will be performed for tons of files, thus a macro would be really helpful).

    This is the the format of the timestamp: 13-08-2013 11:16:11.069

    The way this format is currently, I cannot just simply change the format of the cells to a format I prefer. So, I want to remove the day-month-year part of the time stamp. Once I do this, excel lets me format the 11:16:11.069 portion of the timestamp to other built in cell formats. (i.e mm:ss.00).

    How can I remove that day-month-year portion of the timestamp? The time stamp is in the B column and can vary in size.

    I would really appreciate the help. The tech support guy for the external device was a huge jerk and told me I have to use that timestamp and there's nothing I can do to fix my problem besides buying their $400 data software.

    Thanks guys!

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Excel Timestamp format editing

    okay - a few assumptions

    1) this is not a "real" excel date - IE: text
    2) there is always a space between the date and the time

    Please Login or Register  to view this content.
    change the "A"'s to "B"s
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  3. #3
    Registered User
    Join Date
    08-06-2013
    Location
    boston
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Excel Timestamp format editing

    Hi judgeh59,

    I tried inputing that code in a macro as is, and received the following error:


    Compile error:
    Expected: line number or label or statement or end of statement

    Am I missing something really simple?

    Thanks!

  4. #4
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Excel Timestamp format editing

    no I am....I didn't realize you were putting this in a Macro....

    1) assign that formula to a variable....you'll have to pull the cells references
    2) try using the SPLIT command in VBA.....you have to dim an array
    DIM MyArray()
    then
    MyArray = Split(Cell(row,column).value, " ")

    that splits the cells by the space and then you can access the array like this

    MyArray(1) --- that is the second element in the array ---arrays indices start at 0 unless changed....

  5. #5
    Registered User
    Join Date
    08-06-2013
    Location
    boston
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Excel Timestamp format editing

    worked like a charm! Thanks so much

+ 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] timestamp macro h:mm:ss format error message
    By drsuis in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-15-2013, 02:06 PM
  2. When a timestamp doesn't behave as a timestamp
    By mredekopp in forum Excel General
    Replies: 3
    Last Post: 03-07-2011, 03:39 PM
  3. editing number format
    By mikewiwe in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-18-2010, 11:52 AM
  4. Timestamp format
    By MedTech in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-24-2009, 12:51 PM
  5. Editing Textbox After Format??
    By henryhbb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-06-2005, 09:05 AM

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