View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Robert Crandal[_2_] Robert Crandal[_2_] is offline
external usenet poster
 
Posts: 158
Default Convert time to military time?

Thank you Rick, your code was sufficient enough for
my needs. It was simpler than I expected, because I saw
other examples online that involved modulus arithmetic.

And BTW, I was actually getting the current time from
the "Time" variable (I think).

Thanks again.

----- Original Message -----
From: "Rick Rothstein"
Newsgroups: microsoft.public.excel.programming
Sent: Monday, April 11, 2011 1:18 AM
Subject: Convert time to military time?


Actually, maybe I should fill out that If..Then block...

If IsDate(TextBox1.Value) Then
strMilitaryTime = Format(TextBox1.Value, "hh:mm:ss")
MsgBox "The military time is: " & strMilitaryTime
Else
MsgBox "That is not a correct time value!"
End If

Rick Rothstein (MVP - Excel)