Comma decimal separator giving problems in a VBA Form

wpryan

Well-known Member
Joined
May 26, 2009
Messages
534
Office Version
  1. 365
Platform
  1. Windows
Hi All, I developed a form in VBA that is expecting some numeric entry, and a command button makes some calculations. It is working fine on my computer, but on people who have operating systems that use a comma as a decimal separator, gives incorrect information (in fact, the calculation result always seems to be the number 2, no matter the entered data). The underlying worksheet correctly calculates anything when they use the comma separator, only in the VBA form is it giving problems.

Is there a solution or workaround for this?
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Would have to see your code to have any idea, except to say you can test for regional settings property values and then code accordingly?
For Excel -
application.International(xlDecimalSeparator)
 
Upvote 0
You should most likely be using one of the C functions to coerce the text in the textbox into a number based on the user's regional settings - most likely CDbl or CLng
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

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