ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   decimals: in Europe they use a comma (https://www.excelbanter.com/excel-programming/425240-decimals-europe-they-use-comma.html)

David Macdonald

decimals: in Europe they use a comma
 
I've made a UserForm that lists the first 10 column widths and allows me to
modify them by inputting numerical values.
I'm in Italy so Excel as standard shows me the decimal divider as a comma,
not a point. On my form the 10 current widths are displayed correctly with
commas but if I try setting widths (or resetting the widths as they were
before I opened the form), any values with decimals generate a VBA error. It
must be because VBA isn't international so punctuation is US/UK.
Do I have to incorporate a spell-checking routine just to see if there are
any commas in 10 label captions and 10 textbox texts, before sending the data
from the form or is there a quicker way ?

--
WinXP - Office2003 (Italian)

Peter T

decimals: in Europe they use a comma
 
Sounds like you need to Internationalize your app and parse as text values
necessary

Dim sDecSep As String
sDecSep = Application.International(xlDecimalSeparator)

Look at International in help for more

Regards,
Peter T



"David Macdonald" wrote in
message ...
I've made a UserForm that lists the first 10 column widths and allows me
to
modify them by inputting numerical values.
I'm in Italy so Excel as standard shows me the decimal divider as a comma,
not a point. On my form the 10 current widths are displayed correctly with
commas but if I try setting widths (or resetting the widths as they were
before I opened the form), any values with decimals generate a VBA error.
It
must be because VBA isn't international so punctuation is US/UK.
Do I have to incorporate a spell-checking routine just to see if there are
any commas in 10 label captions and 10 textbox texts, before sending the
data
from the form or is there a quicker way ?

--
WinXP - Office2003 (Italian)




David Macdonald

decimals: in Europe they use a comma
 
Thanks for the hint, Peter.
Unfortunately the Application, Excel, is internationalised.
It looks as if the VBA Editor doesn't follow the main app - probably
connected to often-encountered problem of date formats. I think VBA is
strictly US.
--
WinXP - Office2003 (Italian)


"Peter T" wrote:

Sounds like you need to Internationalize your app and parse as text values
necessary

Dim sDecSep As String
sDecSep = Application.International(xlDecimalSeparator)

Look at International in help for more

Regards,
Peter T



"David Macdonald" wrote in
message ...
I've made a UserForm that lists the first 10 column widths and allows me
to
modify them by inputting numerical values.
I'm in Italy so Excel as standard shows me the decimal divider as a comma,
not a point. On my form the 10 current widths are displayed correctly with
commas but if I try setting widths (or resetting the widths as they were
before I opened the form), any values with decimals generate a VBA error.
It
must be because VBA isn't international so punctuation is US/UK.
Do I have to incorporate a spell-checking routine just to see if there are
any commas in 10 label captions and 10 textbox texts, before sending the
data
from the form or is there a quicker way ?

--
WinXP - Office2003 (Italian)






All times are GMT +1. The time now is 09:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com