Save file with English format Month name

EvilC

Board Regular
Joined
Jul 26, 2014
Messages
74
Hey all,

I have a workbook that after updating needs to be saved without any linked formulas and into a monthly file.
Now i am in Portugal what means that when formatting text for my month it uses the Portuguese language in stead of English. Using formulas there is the [$-409] code i can use that does the job very well. Now i have tried that in a macro, but i can not get this to work. Searching the net also gives me no help so ill try here where all the guru's at ;)

What i have:

Code:
Sub CopyValuesNewFile()


    'Copy all external linked formulas and save them as values
    Worksheets("CALCULATIONS").Columns("V").Copy
  
    Worksheets("CALCULATIONS").Columns("V").PasteSpecial xlPasteValues
    
    Worksheets("CALCULATIONS").Range("$D$2:$U$6").Copy
    
    Worksheets("CALCULATIONS").Range("$D$2:$U$6").PasteSpecial xlPasteValues
  
    'Hide helper Tabs
    Worksheets("CALCULATIONS").Visible = xlSheetVeryHidden
    Worksheets("Addons").Visible = xlSheetVeryHidden
    Worksheets("Control").Visible = xlSheetVeryHidden
          
    'Set new filename and date
    Dim Mon As String, Ye As String, wbName As String, xWB As Workbook
      
    wbName = "Philips_Forecast_Benelux_Draft_"
    Mon = Format(CStr(Now), "[$-409]mmmm")
    Ye = Format(CStr(Now), "_yyyy")
    
    'Disable Excel warnings
    Application.DisplayAlerts = False
    
    'Goto First Sheet
    Worksheets("DASHBOARD CC").Activate
    Range("A1").Activate
      
    'Save new file in right path
    ActiveWorkbook.SaveAs Filename:="\\inffs223\MissionControl\MC\P.EMEA.PHIL_207\01 - Forecast & Sizing\02 - FORECAST\04 - VALIDATION\" & wbName & Mon & Ye, FileFormat:=51, CreateBackup:=False
      
    'Enable Excel warnings
    Application.DisplayAlerts = True
  
End Sub

Thanks in advance for any input.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
This seems to work:

Code:
Mon = WorksheetFunction.Text(Now, "[$-409]mmmm")

I just managed to get some Italian changing it to 410 anyway.
 
Upvote 0
How did this not work, it works for me?
Code:
 Mon = Format(CStr(Now), "[$-409]mmmm")
 
Upvote 0
I still get English too, so it doesn't look as though it works or the [$-409] part is being ignored.:)
 
Upvote 0
Hey Steve,Norie,

For me it does not work, As you guys are in the UK you might not see any difference as your local language is English.

Changing it to 410 still saves it with the local month name "outubro" for me..
 
Upvote 0
Yeah it looks like it uses the locale of the machine disregarding the [$-409] in the format method but in the worksheetfunction.text the [$-409] is used. Seems that way anyway.
 
Upvote 0
Hey Steve,Norie,

For me it does not work, As you guys are in the UK you might not see any difference as your local language is English.

Changing it to 410 still saves it with the local month name "outubro" for me..

Even using worksheetfunction.text? Thats odd as i can get different languages using that.
 
Upvote 0
I can get portuguese too:

Code:
Mon = Format(Now, "[$-0816]mmmm")
Debug.Print Mon
Mon = WorksheetFunction.Text(Now, "[$-0816]mmmm")
Debug.Print Mon

produces:

October
outubro

in the immediate window
 
Upvote 0
I can get portuguese too:

Code:
Mon = Format(Now, "[$-0816]mmmm")
Debug.Print Mon
Mon = WorksheetFunction.Text(Now, "[$-0816]mmmm")
Debug.Print Mon

produces:

October
outubro

in the immediate window

This did the Job. Happy guy :)

Thanks for your help.
 
Upvote 0

Forum statistics

Threads
1,223,247
Messages
6,171,004
Members
452,374
Latest member
keccles

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top