Excel Date Issue

R

Redan

Hi,

I am using Excel 2007 on PC running Windows Vista Ultimate (in french) and
I'd like to return the last month in english instead of french.

strLastMonth = Format(DateAdd("m", -1, Date), "mmmm")

When running the code below, I get "octobre" (in french) and I want to get
"october" no matter what is the language of the pc I'm running my excel
sheet on.

Thanks in advance!
 
M

Mike H

Hi,

One way is to create a table of French month names and their English
translation. In this example I use A1 - B12 but in practice it could be
anywhere out of the way.

strLastMonth = WorksheetFunction.VLookup(Format(DateAdd("m", -1, Date), _
"mmmm"), Sheets("Sheet1").Range("A1:B12"), 2, False)

Mike
 
R

Redan

Thanks Mike!
Mike H said:
Hi,

One way is to create a table of French month names and their English
translation. In this example I use A1 - B12 but in practice it could be
anywhere out of the way.

strLastMonth = WorksheetFunction.VLookup(Format(DateAdd("m", -1, Date), _
"mmmm"), Sheets("Sheet1").Range("A1:B12"), 2, False)

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top