decimals: in Europe they use a comma

  • Thread starter David Macdonald
  • Start date
D

David Macdonald

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 ?
 
P

Peter T

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
 
D

David Macdonald

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top