1.设置单元格格式
.Columns("B:B").NumberFormat = "yyyy-mm-dd"
.Columns("C:D").NumberFormat = "hh:mm"
2.VBA时间列和日期列合并,设置String类型的变量
temp = .Cells(i, 2) + .Cells(i, 3) '
.Cells(i, 3).ClearContents '清空第三列的数据
.Cells(i, 3).NumberFormat = "yyyy-mm-dd hh:mm" '第三列的数据的格式更改
.Cells(i, 3) = temp '第三列的数据由年月日的数据赋值'endTime的处理需要考虑到是否跨天