V
Valued Customer
I want my user to enter the time of day into an input box.
My code looks like this:
Dim CollectionTime As Date
CollectionTime = _
InputBox("Enter Collection Time", "Collection Time", Time)
If I run the macro and accept the input box default, the variable
CollectionTime saves a time value in the format "12:00:00 AM". But if I
enter the time in the format "1200" (no quotes), then CollectionTime
stores a seemingly arbitrary date value. It works if I enter a value as
"12:00" (with the colon), but I don't want to waste my users' time by
making them enter the colon.
I've tried the Help files, I've tried the Format function, and I've
Googled it. This is probably the most retarded question ever, but how do
I force a Date variable to store a value like "1500" as a time value?
As always, thanks a bunch.
My code looks like this:
Dim CollectionTime As Date
CollectionTime = _
InputBox("Enter Collection Time", "Collection Time", Time)
If I run the macro and accept the input box default, the variable
CollectionTime saves a time value in the format "12:00:00 AM". But if I
enter the time in the format "1200" (no quotes), then CollectionTime
stores a seemingly arbitrary date value. It works if I enter a value as
"12:00" (with the colon), but I don't want to waste my users' time by
making them enter the colon.
I've tried the Help files, I've tried the Format function, and I've
Googled it. This is probably the most retarded question ever, but how do
I force a Date variable to store a value like "1500" as a time value?
As always, thanks a bunch.