Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cell Format

Status
Not open for further replies.

SAS343

IS-IT--Management
Oct 1, 2007
3
DK
Hello!

Does anyone know how I can easily define
the format I want to use for a specific cell
when calculating numbers with decimals. What
I mean is I need the numbers to be in 123.45
format with a dot as decimal-separator, but the
cell only accepts comma separated decimals 123,45.

Because I run the Macro-program in different
language settings I need to control the format
of the decimals. Sometimes they need to be comma-
separated and sometimes they need to be dot-separated.
How can I control this easily.

Thanks Hans
 
I'm pretty sure Excel takes its settings from Control Panel > Regional Options. Whether you use a "." or a "," isn't controlled within individual Office applications.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
Yes VBA/Macro program most probably reads
the decimal format from the Windows Regional
Settings. In "my case" it is Swedish Regional
settings and the decimal separator is , comma.

Then when I run my VBA code it stops at a code
where it has populated a parameter ABHR with
value 5,35342 and tries to multiply this by
another number 4224. I get the following error
code

Run-time error 1004 "Application defined or object
defined error".

The strange thing is that is works just fine when
I run the program in English(United States) language
settings.

What can be the problem here?

Thanks Hans
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top