Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
excel vba date format prob.
I have a problem with formating the dates in my macro, when the macro is
done i need to go into the cell and press <enter! but as I need this action to take place in the macro, how do I do this?????? I have tried for a month and nothing happens!! Y.S. Jo --- Message posted from http://www.ExcelForum.com/ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
excel vba date format prob.
Hi
Make sure your macro knows it's really a date before pasting by using a date variable. I also suggest to use Dateserial for setting this, (y, m, d) , then you are independent of the computer's regional settings and formats. Sub Macro1() Dim D As Date D = DateSerial(2004, 1, 30) Range("A1").Value = D 'and if you want to: 'Range("A1").NumberFormat = "dddd mmm.d yyyy" End Sub -- HTH. Best wishes Harald Followup to newsgroup only please. "jo11 " wrote in message ... I have a problem with formating the dates in my macro, when the macro is done i need to go into the cell and press <enter! but as I need this action to take place in the macro, how do I do this?????? I have tried for a month and nothing happens!! Y.S. Jo --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Printing from excel prob. | Excel Discussion (Misc queries) | |||
Weird prob: Format 3rd condition for other than first two | Excel Worksheet Functions | |||
Date prob with Pivot Table | Excel Discussion (Misc queries) | |||
Excel Prob.....What functions? | Excel Discussion (Misc queries) | |||
Excel 2000 date format cannot be set to Australian date format | Excel Discussion (Misc queries) |