View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Peter T[_8_] Peter T[_8_] is offline
external usenet poster
 
Posts: 88
Default VBA time conversion

"RG III" wrote in message
Suppose I have the following string variable:

s = "10:20 PM"

Is there a function that will convert s to military like so?:

s = "2200" ' Now represents military time

-Robert


There's no builtin function but easy enough to roll your own. But why not
simply number-format the cell(s) with "hhmm"

Peter T