Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default 24 hour time

This is what I have so far. I type the start date/time (04/24/06 13:00) and
stop date/time into an input box using a 24-hour clock. Later in the code it
brings up an input box from date1 to date2, etc. In this input box it
switches to using AM and PM. How do I get the input box to keep the 24 hour
clock?

Here's the part that shows Date1 (in column N) to Date2 (in column O):

Range("I" & a - 1).Value = InputBox("Enter MW Amount for period " &
Range("N" & a - 1) & " to " & Range("O" & a - 1))

Any help is appreciated. :)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default 24 hour time


Cells(a - 1, "I").Value = InputBox( _
"Enter MW Amount for period " & _
Format(Cells(a - 1, "N"),"mm/dd/yy hh:mm") & " to " & _
Format(Cells(a - 1, "O"),"mm/dd/yy hh:mm")

HTH
--
AP

PS: I turned Range into Cells, because it's more optimized

"srroduin" a écrit dans le message de
news: ...
This is what I have so far. I type the start date/time (04/24/06 13:00)
and
stop date/time into an input box using a 24-hour clock. Later in the code
it
brings up an input box from date1 to date2, etc. In this input box it
switches to using AM and PM. How do I get the input box to keep the 24
hour
clock?

Here's the part that shows Date1 (in column N) to Date2 (in column O):

Range("I" & a - 1).Value = InputBox("Enter MW Amount for period " &
Range("N" & a - 1) & " to " & Range("O" & a - 1))

Any help is appreciated. :)



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default 24 hour time

Hi

You don't say Range(x).What, just Range(x) , so it uses default, which is
Value. Use
Range("N" & a - 1).Text
to get what the cell actually displays. (AP's solution may be better suited
though, it doesn't change if the user reformat the cells in question.)

I do mean "actually displays", it will read ### if the column is too narrow
to display its real content.

HTH. Best wishes Harald

"srroduin" skrev i melding
...
This is what I have so far. I type the start date/time (04/24/06 13:00)

and
stop date/time into an input box using a 24-hour clock. Later in the code

it
brings up an input box from date1 to date2, etc. In this input box it
switches to using AM and PM. How do I get the input box to keep the 24

hour
clock?

Here's the part that shows Date1 (in column N) to Date2 (in column O):

Range("I" & a - 1).Value = InputBox("Enter MW Amount for period " &
Range("N" & a - 1) & " to " & Range("O" & a - 1))

Any help is appreciated. :)



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default 24 hour time

Works great! Thanks guys.

"Ardus Petus" wrote:


Cells(a - 1, "I").Value = InputBox( _
"Enter MW Amount for period " & _
Format(Cells(a - 1, "N"),"mm/dd/yy hh:mm") & " to " & _
Format(Cells(a - 1, "O"),"mm/dd/yy hh:mm")

HTH
--
AP

PS: I turned Range into Cells, because it's more optimized

"srroduin" a écrit dans le message de
news: ...
This is what I have so far. I type the start date/time (04/24/06 13:00)
and
stop date/time into an input box using a 24-hour clock. Later in the code
it
brings up an input box from date1 to date2, etc. In this input box it
switches to using AM and PM. How do I get the input box to keep the 24
hour
clock?

Here's the part that shows Date1 (in column N) to Date2 (in column O):

Range("I" & a - 1).Value = InputBox("Enter MW Amount for period " &
Range("N" & a - 1) & " to " & Range("O" & a - 1))

Any help is appreciated. :)




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
"h:mm" format, but 12-hour time, not 24-hour time? [email protected] Excel Discussion (Misc queries) 5 September 2nd 08 10:54 AM
Changing decimal time into 24 hour time and reverse Bobzter100 Excel Discussion (Misc queries) 4 January 25th 08 11:38 AM
how to calculate time start & time finish in quarter hour Peter Wu Excel Discussion (Misc queries) 3 June 7th 06 12:58 AM
making a time a measurement of time, not an hour of the day?? small tom Excel Discussion (Misc queries) 7 January 24th 06 02:17 PM
convert time from 60 minute hour to 100 minute hour Jboerding Excel Discussion (Misc queries) 2 July 6th 05 11:30 PM


All times are GMT +1. The time now is 04:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"