ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel Date Issue (https://www.excelbanter.com/excel-programming/419891-excel-date-issue.html)

Redan

Excel Date Issue
 
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!


Mike H

Excel Date Issue
 
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


"Redan" wrote:

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!



Redan

Excel Date Issue
 
Thanks Mike!
"Mike H" wrote in message
...
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


"Redan" wrote:

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!





All times are GMT +1. The time now is 02:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com