Change back to default decimal point separator in Excel for Mac

Zem32619

New Member
Joined
Jul 2, 2021
Messages
26
Office Version
  1. 365
Platform
  1. Windows
Hi, Excel Masters.
In need of your help again. I'm creating a macro code that will convert the comma decimal separator to point(.). The problem is, when the macro was ran on Mac it didn't go back to the original/deault decimal point separator. And all the excel files are now having comma as decimal separator. Below is the code that I used. Can you please help me for a solution to change back to decimal point separator? Thank you in advance.

Dim bCurrent As Boolean

bCurrent = Application.UseSystemSeparators
If bCurrent Then
Application.DecimalSeparator = ","
Application.ThousandsSeparator = "."
Application.UseSystemSeparators = False 'change the current separator to windows default in US setting
MsgBox "You're NOT Using the default System Separators"
Else
Application.UseSystemSeparators = True 'will directly process the excel with the windows default in US setting
MsgBox "You're using default System Separators"
End If
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

rlv01

Well-known Member
Joined
May 16, 2017
Messages
1,966
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Since you know what you changed, why not add some code to explicitly change it back?

VBA Code:
    Dim bCurrent As Boolean

    bCurrent = Application.UseSystemSeparators
    If bCurrent Then
        Application.DecimalSeparator = ","
        Application.ThousandsSeparator = "."
        Application.UseSystemSeparators = False       'change the current separator to windows default in US setting
        MsgBox "You're NOT Using the default System Separators"
    Else
        Application.DecimalSeparator = "."
        Application.ThousandsSeparator = ","
        Application.UseSystemSeparators = True        'will directly process the excel with the windows default in US setting
        MsgBox "You're using default System Separators"
    End If

I have no idea if it will work or not, since I don't have a Mac to test, but there is a decent chance it will.
 
Solution

Zem32619

New Member
Joined
Jul 2, 2021
Messages
26
Office Version
  1. 365
Platform
  1. Windows
Hi rlv01,

Sorry for the very late reply. Thank you for the code. Haven't thought about that. Seems it works. Thank you so much again.
 

Forum statistics

Threads
1,181,427
Messages
5,929,827
Members
436,697
Latest member
sunnypl

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
Top