PDA

View Full Version : Using datevalue with different languages



alpignolo
09-01-2013, 11:09 PM
Hello,
I need to convert a date string like:"15 march 2012" into an actual date using vba.

I know there is the function datevalue, but it doesn't work in my pc because I have an italian version of excel and it doesn't recognize the word march.

my question is if it exists a way to use datevalue independently from the environmental international settings (e.g to instruct vba that the date string is in english/italian/german....).

thank you in advance

snb
09-02-2013, 02:11 AM
=TEXT(TODAY();"[$-410]dddd d mmmm yyyy")

or

=TEXT(TODAY(),"[$-410]dddd d mmmm yyyy")

or use the numberformat to translate the date into Italian.

in VBA:

Sub M_snb()
msgbox [text(today(),"[$-410]dd dddd mmmm yyyy")]
End Sub

Aflatoon
09-02-2013, 02:35 AM
Something like:
Dim strDate as String
dim dteRealDate as Date
strDate = "15 march 2012"
dteRealDate = Evaluate("Datevalue(""" & strdate & """)")

SamT
09-02-2013, 05:04 AM
OutStanding


TEXT() & Cell Format snb = luned́ 2 settembre 2013
Cell Format Italian(Swiss) = luned́, 2. settembre 2013