Consulting

Results 1 to 2 of 2

Thread: Concat date and time in one cell

  1. #1

    Concat date and time in one cell

    I am a new to VBA and would like to ask for help to concatenate a date and time to one cell. Both the date and time values come from separate cells in different and/or same columns. It could be written side by side columnwise or both date and time could be one on top of each other in the same column like below.
    The combined date and time concatenation can be put in a separate column on a different sheet or the same sheet.
    Occurred On (NT) Cleared On (NT)
    12/31/2016 12/31/2016
    22:40:17 22:41:42
    12/29/2016 12/29/2016
    21:49:29 21:50:09

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    It's as simple as something along the lines of

    Range("M1").Value = Range("A2").Text & " " & Range("A3").Text
    You would need to adjust the cells to your situation.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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