+ Reply to Thread
Results 1 to 19 of 19

How do I split the date & time into two separate columns?

Hybrid View

bananajelly How do I split the date &... 08-20-2014, 03:43 PM
ranman256 Re: How do I split the date &... 08-20-2014, 03:54 PM
bananajelly Re: How do I split the date &... 08-20-2014, 04:20 PM
xladept Re: How do I split the date &... 08-20-2014, 04:02 PM
bananajelly Re: How do I split the date &... 08-20-2014, 04:24 PM
bananajelly Re: How do I split the date &... 08-20-2014, 04:25 PM
AlKey Re: How do I split the date &... 08-20-2014, 04:12 PM
bananajelly Re: How do I split the date &... 08-20-2014, 04:27 PM
xladept Re: How do I split the date &... 08-20-2014, 04:42 PM
bananajelly Re: How do I split the date &... 08-20-2014, 05:48 PM
bananajelly Re: How do I split the date &... 09-18-2014, 02:08 PM
xladept Re: How do I split the date &... 08-20-2014, 06:07 PM
xladept Re: How do I split the date &... 09-18-2014, 03:01 PM
bananajelly Re: How do I split the date &... 09-19-2014, 10:48 AM
xladept Re: How do I split the date &... 09-19-2014, 04:01 PM
bananajelly Re: How do I split the date &... 09-19-2014, 04:17 PM
xladept Re: How do I split the date &... 09-19-2014, 07:23 PM
bananajelly Re: How do I split the date &... 09-22-2014, 02:23 PM
xladept Re: How do I split the date &... 09-22-2014, 03:26 PM
  1. #1
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,189

    Re: How do I split the date & time into two separate columns?

    Sub SplitDate()
    Dim vTxt
    
    Range("A2").Select
    While ActiveCell.Value <> ""
       vTxt = ActiveCell.Value
       ActiveCell.Offset(0, 1).Value = "'" & Format(vTxt, "mm/dd/yyyy")  'next col over
       ActiveCell.Offset(0, 2).Value = "'" & Format(vTxt, "hh:nn:ss")    '2 cols over
       
       ActiveCell.Offset(1, 0).Select  'next row
    Wend
    End Sub

  2. #2
    Registered User
    Join Date
    07-29-2013
    Location
    California, United States
    MS-Off Ver
    Excel 2010
    Posts
    49

    Re: How do I split the date & time into two separate columns?

    Thanks Ranman. It was like magic! This is also the first time I heard of the While - Wend statement. I usually only use the While - Loop statement. Cool.

+ 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. Replies: 1
    Last Post: 07-03-2012, 05:49 PM
  2. Split date into 3 separate columns
    By paulr24 in forum Excel General
    Replies: 4
    Last Post: 01-25-2012, 01:51 PM
  3. Merging separate date and time columns into one
    By Gadgets in forum Excel General
    Replies: 5
    Last Post: 07-26-2006, 04:24 PM
  4. [SOLVED] Split a date/time column into 2 columns
    By RKMiller in forum Excel General
    Replies: 1
    Last Post: 12-19-2005, 12:10 PM
  5. Replies: 0
    Last Post: 08-23-2005, 12:23 PM

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