boukaka
asked on
Convert Date to French on button click
Hi all, I have a range that points to a cell that contains a Date. The range is called Period_End_Date, I have a button that switches the language from English to French and vice versa. I need to be able to change the date format to French / English on the fly, can someone show me how to do that? My button code is below.
Public Sub LangGetSet(source As Integer)
'scroll through Language sheet and check against ID passed in
If source = 1 Then
If language = "English" Then
language = "French"
'set date format of Period_End_Date to French (i.e. 20 Mai 2011)
ElseIf language = "French" Then
language = "English"
'set date format of Period_End_Date to English (i.e 20 May 2011)
End If
End If
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks so much, this works beautifully.
You could trap a worksheet_change event, and check if the target correspond to your range. If it correspond, then you need to know in which language you are displaying the date at the moment...