Using VBA to detect which decimal sign the computer is using

前端 未结 6 1419
你的背包
你的背包 2020-11-30 12:54

Is it possible to use VBA to detect which decimal sign is being used on the computer?

I have a macro script that adds a conditional formatting to an excel sheet. The

6条回答
  •  再見小時候
    2020-11-30 13:01

    Regarding the answer above, it is important to know that Application.DecimalSeparator and Application.International(xlDecimalSeparator) do not behave the same way:

    • Application.DecimalSeparator will ALWAYS output the decimal separator chosen in Excel options even when Excel is told to use System Separators (from Windows regional settings)
    • Application.International(xlDecimalSeparator) will output whatever is the actual decimal separator used by Excel whether it comes from Windows settings (when Application.UseSystemSeparators = True) or from Excel options (when Application.UseSystemSeparators = False)

    I therefore strongly recommend to always use Application.International(xlDecimalSeparator).

提交回复
热议问题