Date format from VB to excel
Date format from VB to excel
(OP)
I have a data entry from in VB which automatically adds the date to the entry on the excel workbook. When the auto date is shown on the form, it is in the format I want it. It shows it in the same format as it grabs my system date (dd/mm/yy). When I put the entry on my worksheet, it puts it in mm/dd/yy, even if i specify for the destination field to have the dd/mm/yy format. for example, the 10th of May 2002 will show on my form as 10/05/02. It will show as 05/10/02 on my excel worksheet, even if I set it to dd/mm/yy.
Any suggestions???
Any suggestions???





RE: Date format from VB to excel
If you wanted to insert the formated date into cell A1, you would ues the following code:
Range("A1").Value = Date
Range("A1").NumberFormat = "mmmm d, yyyy"
This will give you "May 10, 2002"
You can play with the formating to get the format you want. It is often useful to record a macro when faced with problems like this.
Good Luck!
jproj