Override regional settings

Runejors

New Member
Joined
Nov 27, 2023
Messages
5
Office Version
  1. 365
Platform
  1. Windows
i lkike t create a template that override regional setting. it's from Eu to US format
Dateformat to be mm/dd/YYYY in column B
comma seperator "." in column C
users are novices in excel usage. An I have no VBA knowledge ;)
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
1. You can set the date format of a cell in any way you prefer (Right-click, Format cells)
2. You did not mention why you want to do this?
 
Upvote 0
1. You can set the date format of a cell in any way you prefer (Right-click, Format cells)
2. You did not mention why you want to do this?
Hi
this is a timesheet where users ad date and number as regional settings. these data shal be copied and importet to a system where date format is MM/DD/YYYY. we are using DD.MM.YYYY in regional setting. So i beleive we have 2 option
1. Predefine settings in workbook
2. Change format prior to copy data to a .CSV file or maybe change format in CS V file
 
Upvote 0
If you use a small VBA macro to save-as the file to CSV, Excel automatically uses US formats:

VBA Code:
Sub SaveAsCSV()
    ActiveWorkbook.SaveAs "c:\SomePath\SomeFIleName.csv", xlCSV
End Sub
 
Upvote 0
If you use a small VBA macro to save-as the file to CSV, Excel automatically uses US formats:

VBA Code:
Sub SaveAsCSV()
    ActiveWorkbook.SaveAs "c:\SomePath\SomeFIleName.csv", xlCSV
End Sub
I dont have VBA knowledge. so io dont know how to ad this in the excelfile
is it possible to ask for a path instead of have one predefined?
 
Upvote 0
  1. Open your workbook, press alt+F11
  2. Click Insert, Module
  3. Paste the code I show below
  4. Press Alt+F11 again to return to Excel
  5. Press File, Save as. Make sure you select the macro enabled file type (.xlsm).
Here's the code:
VBA Code:
Sub SaveFileAsCSV()
    Dim vFilename As Variant
    Dim sPath As String
    sPath = Environ("USERPROFILE") & "\Documents\"
    vFilename = Application.GetSaveAsFilename(sPath, "Text Files, *.csv", , "Please enter a filename")
    If TypeName(vFilename) = "Boolean" Then Exit Sub
    If vFilename = "" Then Exit Sub
    ThisWorkbook.SaveAs vFilename, xlCSV
End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,223,237
Messages
6,170,928
Members
452,366
Latest member
TePunaBloke

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