ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   displaying yy instead of yyyy (https://www.excelbanter.com/excel-programming/336843-displaying-yy-instead-yyyy.html)

josh7

displaying yy instead of yyyy
 
When I enter a date value in excel spreadsheet like 01-Jun-2005 ,its saving
the value as 01-Jun-05 instead of 01-Jun-2005.What should I do to save it as
01-Jun-2005.
Thanks,
Joshua


Norman Jones

displaying yy instead of yyyy
 
Hi Josh7,

Format the date entry cells with a custom format:

dd-mmm-yyyy

---
Regards,
Norman



"josh7" wrote in message
...
When I enter a date value in excel spreadsheet like 01-Jun-2005 ,its
saving
the value as 01-Jun-05 instead of 01-Jun-2005.What should I do to save it
as
01-Jun-2005.
Thanks,
Joshua




josh7

displaying yy instead of yyyy
 
I have used the statement Format(sysdate,"dd-mm-yyyy) in Visual basic 6.But
as soon as it gets entered in Excel its truncates the date to dd-mm-yy. Is
there a way to automate this process using Visual Basic 6 to dd-mm-yyyy
Thanks,
Joshua



"Norman Jones" wrote:

Hi Josh7,

Format the date entry cells with a custom format:

dd-mmm-yyyy

---
Regards,
Norman



"josh7" wrote in message
...
When I enter a date value in excel spreadsheet like 01-Jun-2005 ,its
saving
the value as 01-Jun-05 instead of 01-Jun-2005.What should I do to save it
as
01-Jun-2005.
Thanks,
Joshua





Norman Jones

displaying yy instead of yyyy
 
Hi Joshua,

The following worked for me for a specified range.

Sub XYZ()
Dim rng As Range

Set rng = Range("A1:A10")
With rng
.NumberFormat = "dd-mm-yyyy"
.Cells(1).Value = "01-Jun-2005."
End With

End Sub

I am not aware of a way to change the default behavior.


---
Regards,
Norman



"josh7" wrote in message
...
I have used the statement Format(sysdate,"dd-mm-yyyy) in Visual basic 6.But
as soon as it gets entered in Excel its truncates the date to dd-mm-yy. Is
there a way to automate this process using Visual Basic 6 to dd-mm-yyyy
Thanks,
Joshua



"Norman Jones" wrote:

Hi Josh7,

Format the date entry cells with a custom format:

dd-mmm-yyyy

---
Regards,
Norman



"josh7" wrote in message
...
When I enter a date value in excel spreadsheet like 01-Jun-2005 ,its
saving
the value as 01-Jun-05 instead of 01-Jun-2005.What should I do to save
it
as
01-Jun-2005.
Thanks,
Joshua







josh7

displaying yy instead of yyyy
 
Hi Norman,
Thanks for saving my day.
Joshua


"Norman Jones" wrote:

Hi Joshua,

The following worked for me for a specified range.

Sub XYZ()
Dim rng As Range

Set rng = Range("A1:A10")
With rng
.NumberFormat = "dd-mm-yyyy"
.Cells(1).Value = "01-Jun-2005."
End With

End Sub

I am not aware of a way to change the default behavior.


---
Regards,
Norman



"josh7" wrote in message
...
I have used the statement Format(sysdate,"dd-mm-yyyy) in Visual basic 6.But
as soon as it gets entered in Excel its truncates the date to dd-mm-yy. Is
there a way to automate this process using Visual Basic 6 to dd-mm-yyyy
Thanks,
Joshua



"Norman Jones" wrote:

Hi Josh7,

Format the date entry cells with a custom format:

dd-mmm-yyyy

---
Regards,
Norman



"josh7" wrote in message
...
When I enter a date value in excel spreadsheet like 01-Jun-2005 ,its
saving
the value as 01-Jun-05 instead of 01-Jun-2005.What should I do to save
it
as
01-Jun-2005.
Thanks,
Joshua









All times are GMT +1. The time now is 12:14 AM.

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