Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Data Validation when entering hours over 24

Hiya,

I'm having problems adding data validation to some cells where the
time can be over 24 hours.

I know that the cells must be formatted [h]:mm to be viewed properly
and have successfully added validation to allow only times of 0:00 and
above (including 24+) by using Time - Greater Than - 00:00:00.

The problem:

If a user types 1 and then hits enter it seems to convert it to days
so the cell shows 24:00.

What I need (if possible) is to force the user to add a colon to make
sure that the number of hours are entered correctly. This could be
anywhere from 00:00 to 100:00+

I have seen code that allows users to enter times without the colon(eg
entering 2300 will show as 23:00 in the cell) but this only applies to
the 24 hour clock and was unable to modify it to suit my needs.

Any help is appreciated!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Data Validation when entering hours over 24

Hi,

You can use Data Validation, Then set it into TIME, this will prevent
the user to encode any type of characters but time only.

Hope it will help.
~jaeson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Data Validation when entering hours over 24

On Jan 15, 12:27*am, DCG-jaeson wrote:
Hi,

You can use Data Validation, Then set it into TIME, this will prevent
the user to encode any type of characters but time only.

Hope it will help.
~jaeson



Another, if you want the user that can encode greater than 23:59, you
can set the Data Validation into DATE.

Hehe!
~jaeson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Data Validation when entering hours over 24

On Fri, 14 Jan 2011 08:27:41 -0800 (PST), DCG-jaeson
wrote:

Hi,

You can use Data Validation, Then set it into TIME, this will prevent
the user to encode any type of characters but time only.

Hope it will help.
~jaeson



Or make a list of valid time entries, and use the list as a drop down
list.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Data Validation when entering hours over 24

Absolutely

Setup up Data Validation Dropdown List

Make your list in increments of 15 min blocks which helps with continuity.

00:00 = (Midnight)
00:15
00:30
00:45
01:00

Down to

23:45 = 15 (minute to midnight)

etc........

This way users can only select what you want them to....

HTH
Mick




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Data Validation when entering hours over 24

On Sat, 15 Jan 2011 23:32:33 +1100, "Vacuum Sealed"
wrote:

Absolutely

Setup up Data Validation Dropdown List

Make your list in increments of 15 min blocks which helps with continuity.

00:00 = (Midnight)
00:15
00:30
00:45
01:00

Down to

23:45 = 15 (minute to midnight)

etc........

This way users can only select what you want them to....

HTH
Mick


I go one step further with my example on the MS template site.

I allow the user to select the increment size.

1,2,5,10,15, & 30 minute increments are included.

That way, any billing or timekeeping paradigm can be used.

http://office.microsoft.com/en-us/te...r-expenditure-...

or

http://tinyurl.com/24rgy67
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Data Validation when entering hours over 24

Thanks for the help but it doesn't really solve my issue.

I need to allow entries of up to 1000 hours. It wouldn't really be
suitable to have that many entries on a list as we need the times to
be accurate to the closest minute. Even if I have one list for hours
and one for minutes the lists would still be too long.

As mentioned I have tried time and date validation but my main concern
is that someone could enter 1, resulting in the cell returning 24:00
as opposed to entering 1: and getting 1:00.

I guess my main bet is to rely on the competence of users but I would
have preferred to get a solid validation alternative.


Thanks anyway.

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Data Validation when entering hours over 24

On 15/01/2011 4:04 a.m., Andy wrote:
Hiya,

I'm having problems adding data validation to some cells where the
time can be over 24 hours.

I know that the cells must be formatted [h]:mm to be viewed properly
and have successfully added validation to allow only times of 0:00 and
above (including 24+) by using Time - Greater Than - 00:00:00.

The problem:

If a user types 1 and then hits enter it seems to convert it to days
so the cell shows 24:00.

What I need (if possible) is to force the user to add a colon to make
sure that the number of hours are entered correctly. This could be
anywhere from 00:00 to 100:00+

I have seen code that allows users to enter times without the colon(eg
entering 2300 will show as 23:00 in the cell) but this only applies to
the 24 hour clock and was unable to modify it to suit my needs.

Any help is appreciated!

Could you have them enter the time using a UF and have separate boxes
for hours and minutes? Then sort out the formatting after.
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
Entering a long formumla in Validation criteria salgud Excel Programming 4 July 14th 09 08:40 PM
Data Validation lists - entering value not in list rgarber50 Excel Discussion (Misc queries) 3 July 19th 05 08:35 PM
Problems entering Data validation Programatically J Streger Excel Programming 3 April 1st 05 05:30 PM
How do I calculate the hours spent on a project by entering a sta. joeh Excel Worksheet Functions 4 November 2nd 04 06:39 PM
DATA ENTERING IN DATA VALIDATION No Name Excel Programming 1 July 21st 03 10:19 AM


All times are GMT +1. The time now is 12:15 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"