View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
josh7 josh7 is offline
external usenet poster
 
Posts: 7
Default 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