Results 1 to 5 of 5

Thread: Excel, date and time

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    9
    Hello,

    I have an excel spreadsheet with date and time in the same cell. My question is how do I separate thos data and put them into two different cells ?

    The data looks like this:

    1999-06-30 18:26:31

    Then, I have to erase informations concerning seconds.

    Any suggestion ?

  2. #2
    New Member
    Join Date
    Mar 2000
    Posts
    10
    Hello,

    The function of date: is the date itself say 1999-06-30 and the time 18:26:31

    I don't know about separating them but copy and pasting them
    into an adjacent cell and then format one cell for time and one cell for date.... Just pick the correct category and type...

    I don't know if it will help or not?!?!?

  3. #3
    Lively Member
    Join Date
    Jun 1999
    Posts
    120
    use NumberFormatLocal...
    for example...

    Code:
    ' A1 contains the date plus the time
    ' A2 will contain the date
    ' A3 will contain the time
        Range("A2").Value = Range("A1").Value
        Range("A2").NumberFormatLocal = "yyyy/mm/dd"
        Range("A3").Value = Range("A1").Value
        Range("A3").NumberFormatLocal = "hh:mm"
    ' This is applicable in VBA- Excel

  4. #4
    Addicted Member
    Join Date
    Jul 1999
    Location
    Portland, OR.
    Posts
    226
    Hi.

    Try these short cuts. They make live much easier

    To enter the current date into the active cell, press [Ctrl][;]

    To enter the current time, press [Ctrl][Shift][;]

    If you want to use them from VB, Use SendKey .

    Good Luck.

    Lyla

    [Edited by Lyla on 03-21-2000 at 11:22 PM]

  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    9
    Ok, thank you all for the answers...

    Nankien

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width