Thread: More Dates
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
robzrob[_2_] robzrob[_2_] is offline
external usenet poster
 
Posts: 17
Default More Dates

On Aug 16, 5:12*pm, Joel wrote:
Treat the date as text as you should be ok.

Dim DateStr as STRING

DateStr = trim(UserForm1.TextBox3.Value)
'make the cell text format.
Worksheets("Leave").Range("K5").numberformat = "@"
'put a single queote in fron ta dtate just to be sure in is a strin
Worksheets("Leave").Range("K5").numberformat = "'" & DateStr



"robzrob" wrote:
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.- Hide quoted text -


- Show quoted text -


Major Excel crash. It's still sending the error report even now!