Dim offerTime As Date
Dim i As Integer
Dim temp As String
offerTime = #12:00:00 AM#
temp = ""
For i = 1 To 24
temp = temp & DateAdd("h", i, offerTime) & " ,"
Next i
Debug.Print temp
output
1:00:00 AM ,2:00:00 AM ,3:00:00 AM ,4:00:00 AM ,5:00:00 AM ,6:00:00 AM ,7:00:00 AM ,8:00:00 AM ,9:00:00 AM ,10:00:00 AM ,11:00:00 AM ,12:00:00 PM ,1:00:00 PM ,2:00:00 PM ,3:00:00 PM ,4:00:00 PM ,5:00:00 PM ,6:00:00 PM ,7:00:00 PM ,8:00:00 PM ,9:00:00 PM ,10:00:00 PM ,11:00:00 PM ,[highlight]12/31/1899[/highlight]
I will add 24 or less, not 24 every time.
I think this is because there is no date associated with the time. I don't want to associate a date.
Dim i As Integer
Dim temp As String
offerTime = #12:00:00 AM#
temp = ""
For i = 1 To 24
temp = temp & DateAdd("h", i, offerTime) & " ,"
Next i
Debug.Print temp
output
1:00:00 AM ,2:00:00 AM ,3:00:00 AM ,4:00:00 AM ,5:00:00 AM ,6:00:00 AM ,7:00:00 AM ,8:00:00 AM ,9:00:00 AM ,10:00:00 AM ,11:00:00 AM ,12:00:00 PM ,1:00:00 PM ,2:00:00 PM ,3:00:00 PM ,4:00:00 PM ,5:00:00 PM ,6:00:00 PM ,7:00:00 PM ,8:00:00 PM ,9:00:00 PM ,10:00:00 PM ,11:00:00 PM ,[highlight]12/31/1899[/highlight]
I will add 24 or less, not 24 every time.
I think this is because there is no date associated with the time. I don't want to associate a date.