Concatenation time and decimal time in mm / dd / yyyy hh format: mm format

For timings 7:00 AM; 7:15 AM, .... 17:00; 17:15in strings and date in range B6, I am trying to combine values, but the value I get is in format 02/21/2018 0.29917. How to convert it to format 02/21/2018 7:00and so on ...

c- time value ( 7:00 AM, 7:15 AM... 6:00 PM)

For i = 0 To lRow - 1
    c = ActiveCell.Offset(i, 0).Value
    ActiveCell.Offset(i, 0).Value = dateofProject & " " & c
Next i
+4
source share
1 answer

Add time to date to reach date and time.

ActiveCell.Offset(i, 0).Value = dateofProject + c

Format the result cells as mm/dd/yyyy hh:mm am/pm.

This assumes that the date is a real date, and the times are real, not tags that are similar to date and time.

+4
source

Source: https://habr.com/ru/post/1693914/


All Articles