Entering dates

NorthMelbourne

New Member
Joined
Jan 13, 2002
Messages
3
Prior to an upgrade from XL97 to XL2000 I was able to enter a date such as April 8 2002 as 080402. Now XL is interpreting 080402 as 80402 (dropping the leading 0) and the formatted result is February 17 2120. Any ideas on how I might be able to enter dates without requiring separater symbols such as '/' and '-'.

Any feedback will be much appreciated.
NM
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
If the field you want to enter the date this way in cell A1:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error GoTo notdate
If Target.Address <> "$A$1" Then
x = Str(Range("A1"))
x = Format(x, "00\/00\/00")
x = DateValue(x)
Range("A1").Value2 = x
Range("A1").NumberFormat = "m/d/yy"
End If
notdate:
End Sub
 
Upvote 0
format the cells where you want to enter dates as 00-00-00
(menu format / cellproperties / tab "number" ==> choose custom and type 00-00-00)
but the problem is that you can't count correctly with them entered in this way
example 31-04-04 - 30-04-04 should be 1 but you'll get 10000

regards,
Erik
 
Upvote 0
With the format cells option, if you need to refer to that value as a date, you can refer to it with a formula like this:

=DATEVALUE(TEXT(A1,"00-00-00"))
 
Upvote 0

Forum statistics

Threads
1,214,415
Messages
6,119,382
Members
448,889
Latest member
TS_711

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top