As I understand a true date serial in Excel contains both date and time values. The information that is provided is based on the formatting applied to the serial.
I have a date from cell F22 formatted at 2019-04-28. Reformatted to include the time, I get 2019-04-28 12:00:00 AM
I have a textbox on a userform where the user enters a time. I use CDate formatted with "h:mm AM/PM" to convert it to a true time value (stime = CDate(Me.uf9a_tb_cstart.Value)) . If 7:00 is entered, the resulting value of stime = 7:00 AM. If I reformat it to include the date I get an obscure 30-12-99 7:00 AM.
My question is, how can I combine the date from the cell value of F22 and the time value from the textbox into one value (stime) with a VBA solutioN?
As an example using the data mentioned, a value formatted as "dd-mm-yy h:mm:ss am/pm" will result in stime = 28-04-19 7:00 AM?
Bookmarks