我需要一种方法来使用用户表单上的输入来确定将显示在输出上的日期。下面是我的代码:
If StatusBox.Value <= "23:59" And ShiftCode.Value = "AA5" Then
Cells(emptyRow, 8).Value = ((Date - 1) + " " + StatusBox.Value + " " + "CEST")
Else
Cells(emptyRow, 8).Value = (Date + " " + StatusBox.Value + " " + "CEST")
End If基本上,我需要将日期显示为Date - 1,当来自StatusBox.Value的输入小于或等于11:59 PM or 23:59时,StatusBox字段上的输入将始终采用12小时格式。
发布于 2015-10-20 14:08:13
从较高的时间值中减去较低的时间值,如` `elapsedTime = endTime - startTime‘。在得到结果之前,不要摆弄文本字符串、格式化和拼接。
https://stackoverflow.com/questions/33229023
复制相似问题