ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Date Format Structure (https://www.excelbanter.com/excel-worksheet-functions/16870-re-date-format-structure.html)

Jay

Date Format Structure
 
Is there a method that would convert any Date entered into a cell whether
it's 06/01/05 or June-2005 or 06/01/2005 or any other entry to June-05 (and
still be a valid date) and not show-up as 06/01/05 in the formula bar, but as
June-05 instead?

Bob Umlas, Excel MVP

Right-click the sheet tab, select View code, enter this:
Private Sub Worksheet_Change(ByVal Target As Range)
If IsDate(Target.Resize(1, 1).Value) Then Target.Resize(1,
1).NumberFormat = "mmmm-dd"
End Sub

HTH
Bob Umlas,Excel MVP

"Jay" wrote:

Is there a method that would convert any Date entered into a cell whether
it's 06/01/05 or June-2005 or 06/01/2005 or any other entry to June-05 (and
still be a valid date) and not show-up as 06/01/05 in the formula bar, but as
June-05 instead?


Myrna Larson

YOu can change the cell format to display mmm-yy or mmmm-yyyy, etc, but that
doesn't affect what you see in the formula bar. It will still show the month,
day, and year.

On Wed, 9 Mar 2005 09:55:03 -0800, Jay wrote:

Is there a method that would convert any Date entered into a cell whether
it's 06/01/05 or June-2005 or 06/01/2005 or any other entry to June-05 (and
still be a valid date) and not show-up as 06/01/05 in the formula bar, but as
June-05 instead?




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

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