ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Date Display (https://www.excelbanter.com/excel-discussion-misc-queries/166196-date-display.html)

Patty

Date Display
 
How can I configure a cell so that I can enter 11152007 as a date and have it
display as 11/15/2007?

Thanks,

patty

Gary''s Student

Date Display
 
You can use another cell:
=DATE(RIGHT(D23,4),LEFT(D23,2),MID(D23,3,2))

or you can use VBA to do the same thing in a single cell.
--
Gary''s Student - gsnu200756


"Patty" wrote:

How can I configure a cell so that I can enter 11152007 as a date and have it
display as 11/15/2007?

Thanks,

patty


Patty

Date Display
 
What is VBA?

"Gary''s Student" wrote:

You can use another cell:
=DATE(RIGHT(D23,4),LEFT(D23,2),MID(D23,3,2))

or you can use VBA to do the same thing in a single cell.
--
Gary''s Student - gsnu200756


"Patty" wrote:

How can I configure a cell so that I can enter 11152007 as a date and have it
display as 11/15/2007?

Thanks,

patty


Peo Sjoblom

Date Display
 
If it is only for display and not for any calculations whatsoever you can
use a custom format like

00\/00\/0000

and it will display as you want



if you really want a date that Excel will read as a date you would need
either a help cell with a formula like

=--TEXT(A1,"00\/00\/0000")

then format that cell as a regular date

or you can use an event macro

http://www.cpearson.com/excel/DateTimeEntry.htm


--


Regards,


Peo Sjoblom




"Patty" wrote in message
...
How can I configure a cell so that I can enter 11152007 as a date and have
it
display as 11/15/2007?

Thanks,

patty




Gary''s Student

Date Display
 
It is a language available to Excel to allow automation of steps you do
manually. For example:

Private Sub Worksheet_Change(ByVal Target As Range)
Set t = Target
Set r = Range("A1")
If Intersect(t, r) Is Nothing Then Exit Sub
v = t.Text
Dim d As Date
d = DateSerial(Right(v, 4), Left(v, 2), Mid(v, 3, 2))
Application.EnableEvents = False
r.Value = d
Application.EnableEvents = True

will wait until you enter the number in A1 and then change it to a date.
This way only one cell is used, not two.
--
Gary''s Student - gsnu200756


"Patty" wrote:

What is VBA?

"Gary''s Student" wrote:

You can use another cell:
=DATE(RIGHT(D23,4),LEFT(D23,2),MID(D23,3,2))

or you can use VBA to do the same thing in a single cell.
--
Gary''s Student - gsnu200756


"Patty" wrote:

How can I configure a cell so that I can enter 11152007 as a date and have it
display as 11/15/2007?

Thanks,

patty



All times are GMT +1. The time now is 07:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com