Thread: More Dates
View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default More Dates


AFAIK Excel cannot handle negative times.


With the 1904 date setting turned off, Excel cannot DISPLAY negative
times, but since a time is just a number, it can certainly "handle"
negative times in the sense that it can use them in calculations.

With the 1904 date setting turned on, Excel can display negative
times.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Sun, 16 Aug 2009 18:11:26 +0200, "JP Ronse"
wrote:

Hi Rob,

As before,

use timevalue(me..TextBox3.text)

AFAIK Excel cannot handle negative times.

Wkr,

JP
"robzrob" wrote in message
...
In a UserForm I've got a TextBox asking for an amount of time (hours
and minutes). It could be negative. If the user wants to enter a
negative date, I want them to be able to just enter, for example:
-3:04, -10:53, etc. I'm in 1904 mode. My code for this value is:

Worksheets("Leave").Range("K5").Value = UserForm1.TextBox3.Value

I've tried inputting times like this: -3:04 and this: -"3;04", but
neither will do.