Change back to default decimal point separator in Excel for Mac

Zem32619

New Member
Joined
Jul 2, 2021
Messages
29
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

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
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.
 
Upvote 0
Solution
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.
 
Upvote 0

Forum statistics

Threads
1,214,544
Messages
6,120,126
Members
448,947
Latest member
test111

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