Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date local format
In the VBA I tried the following:
MyDate = DateSerial(2004, 7, 30) MsgBox Format(MyDate, "mmmm yyyy") it gave me the month and the year in my language (as in the regional options in windows control panel) I want to force the result to give me "July 2004" regardless the settings in the windows. In a worksheet, I can format such a date with "B1mmm yyyy" to give me what I want. But in VBA, the "format" function didn't accept the "B1mmm yyyy" to format MyDate. Any ideas? Thanks in advance |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date local format
Marwan,
This function will do the trick: Function getDString (myDate) getDString = Application.GetCustomListContents(4)(Month(myDate) ) & " " & Year(myDate) End Function Stan Scott New York City "marwan Hefnawy" wrote in message om... In the VBA I tried the following: MyDate = DateSerial(2004, 7, 30) MsgBox Format(MyDate, "mmmm yyyy") it gave me the month and the year in my language (as in the regional options in windows control panel) I want to force the result to give me "July 2004" regardless the settings in the windows. In a worksheet, I can format such a date with "B1mmm yyyy" to give me what I want. But in VBA, the "format" function didn't accept the "B1mmm yyyy" to format MyDate. Any ideas? Thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
permanent conversion of 1904 date format to 1900 date format | Excel Worksheet Functions | |||
Convert date + time text format to date format | Excel Worksheet Functions | |||
VBA Setting .Value to a date does not respect local system setting | Excel Programming | |||
Reference styles and local/non-local formulae - international problems. | Excel Programming | |||
Change a date in text format xx.xx.20xx to a recognised date format | Excel Programming |