+ Reply to Thread
Results 1 to 5 of 5

trying to concat 2 cells in one DateTime value

  1. #1
    Registered User
    Join Date
    02-28-2007
    Location
    MOntreal
    MS-Off Ver
    Office 2010
    Posts
    12

    trying to concat 2 cells in one DateTime value

    Hi,

    I have one cell that contain a date and one another that contain a time.

    I'm simply trying to create a third one of the following format dd/mm/yy hh:mm. I have tried many thing in VB but none of them work.

    Any idea?

    thanks

    acheo

  2. #2
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: trying to concat 2 cells in one DateTime value

    do you need to do in VBA?

    date and time are simply numbers. I'm assuming your two cells are simply numbers and formatted as date and time only

    if A1 is a whole number and A2 is a fraction only then

    = A1 + A2 and format as dd/mm/yy hh:mm
    Happy with my advice? Click on the * reputation button below

  3. #3
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: trying to concat 2 cells in one DateTime value

    Oh and if the above is correct in regards to how your cells are formated then all you need for a macro would be something like this

    Range("a3").Value = Range("a1").Value + Range("a2").Value

  4. #4
    Registered User
    Join Date
    02-28-2007
    Location
    MOntreal
    MS-Off Ver
    Office 2010
    Posts
    12

    Re: trying to concat 2 cells in one DateTime value

    Yes VBA is required as I will export the data into a database. I just tried that code in VBA and it works. I knew it had to be simple :-)

    thanks a lot!

    acheo

  5. #5
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: trying to concat 2 cells in one DateTime value

    Great. Glad it worked. You should show the thread as being solved if this has addressed your issue

+ 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. if statement for datetime value between two other datetime values
    By OSepulvedaIII in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-15-2016, 10:37 AM
  2. Replies: 0
    Last Post: 06-05-2014, 10:45 AM
  3. Combine multiple cells in columns - Concat with variable spacing using VBA Script
    By AMC_CO in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-13-2013, 03:57 PM
  4. [SOLVED] concat cells based on date range
    By DamianWarS in forum Excel General
    Replies: 8
    Last Post: 09-14-2012, 12:39 PM
  5. Get data between two datetime cells
    By PhAnT0M in forum Excel General
    Replies: 1
    Last Post: 03-28-2012, 04:53 PM
  6. Based on a Column datetime value auto calculate and populate a datetime range
    By rajashanmuga in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-22-2010, 04:10 PM
  7. Subtracting datetime cells
    By anj in forum Excel General
    Replies: 2
    Last Post: 09-27-2007, 06:57 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