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

I have a create, edit, delete program I've done in excel and I need to
pass a start time and end time value back and forth from cells to my
userform. I've tried using military format HHMM and 00\:00. It works
fine passing the time value from the userform to the cell, but not the
other way!! Here's my variable (dim as date):

BeforeEditStartTime = Format(Range("F" & rowindex).Text, "HHMM")

The cell this value is entered in is in custom HHMM format. When I pass
it back to the program it reads (for example) 1200 as 0000 or 12:00:00
AM.

HELP!!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default military time formatting...

Try changing .Text to .Value. The format function takes a date (or number)
and converts it to a text string with a specific format applied. What you are
doing is passing in a string which format can't do too much with...
--
HTH...

Jim Thomlinson


"sbowman" wrote:

I have a create, edit, delete program I've done in excel and I need to
pass a start time and end time value back and forth from cells to my
userform. I've tried using military format HHMM and 00\:00. It works
fine passing the time value from the userform to the cell, but not the
other way!! Here's my variable (dim as date):

BeforeEditStartTime = Format(Range("F" & rowindex).Text, "HHMM")

The cell this value is entered in is in custom HHMM format. When I pass
it back to the program it reads (for example) 1200 as 0000 or 12:00:00
AM.

HELP!!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default military time formatting...

nevermind I fixed it by formatting the cells as text instead of
general. I'm not doing any time calculations, so it's fine to have it
as text instead of a date.

Thanks anyway...
Shelley

Jim Thomlinson wrote:
Try changing .Text to .Value. The format function takes a date (or number)
and converts it to a text string with a specific format applied. What you are
doing is passing in a string which format can't do too much with...
--
HTH...

Jim Thomlinson


"sbowman" wrote:

I have a create, edit, delete program I've done in excel and I need to
pass a start time and end time value back and forth from cells to my
userform. I've tried using military format HHMM and 00\:00. It works
fine passing the time value from the userform to the cell, but not the
other way!! Here's my variable (dim as date):

BeforeEditStartTime = Format(Range("F" & rowindex).Text, "HHMM")

The cell this value is entered in is in custom HHMM format. When I pass
it back to the program it reads (for example) 1200 as 0000 or 12:00:00
AM.

HELP!!



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
Converting Standard Time to Military Time in Excel mtvschultz Excel Discussion (Misc queries) 3 May 5th 23 11:42 AM
Converting standard time to military time C. Excel Worksheet Functions 9 June 1st 17 10:06 PM
formula for converting military time to standard time, etc Pattio Excel Discussion (Misc queries) 8 February 17th 08 01:12 AM
Converting Standard Time into Military Time mtvschultz Excel Discussion (Misc queries) 3 February 15th 08 07:34 PM
Show timesheet time in and out in regular time versus military tim John Excel Worksheet Functions 1 November 11th 05 05:14 AM


All times are GMT +1. The time now is 01:14 PM.

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"