Thread: Time Formatting
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Time Formatting

Couple of issues:

1) XL certainly has "VB Coding" - XL macros are written in VBA. Event
macros can be fired on cell entry.

2) XL's parser will parse the entry before any macros can read the data.
The only way to enter 8-4 and NOT have it interpreted as a date is to
make sure the cell is formatted as Text (so it is not parsed).

3) Before spending time writing an event macro, you don't give enough
info to be definitive. Should 6-6 be 6:00 AM - 6:00 PM, or 6:00 PM to
6:00 AM? What about 5-7 or 7-5? What criteria should be used to
determine AM/PM?

In article ,
"Tatakau" wrote:

I am trying to speed up the rate that people can enter information into a
spreadsheet. I don't know exactly how to describe this... so I'll give a few
examples.


When someone types in '8-4', Excel changes the field to '4 Aug'. Instead,
I'd like it to read as '8:00 AM - 4:00 PM'. More examples below


Entered Desired
8-4 8:00 AM - 4:00 PM
1-5 1:00 PM - 5:00 PM
7-3:30 7:00 AM - 3:30 PM


I tried to format the cells to do this for me, but I can't figure it out. I
could do this in Access, but Excel doesn't have any VB coding as far as I can
tell. I know that accomplishing this is probably overly complicated, but if
anyone has any suggestions, I would greatly appreciate it.

Thanks,

Nick