G
Guest
I have a macro that is used by people in the US and in
Germany. The macro adds columns to check total debits vs.
total credits.
When I run it in the US, it works fine because it sees
50.25. But when the macro runs for one of the German
users, it sees 50,25 and it doesn't use the 25 in
calculating the total.
The reason for the difference is in this line of code:
TotalDebits = TotalDebits + Val(ActiveCell.Offset(0, 5))
According to Help: "The Val function recognizes only the
period (.) as a valid decimal separator. When different
decimal separators are used, as in international
applications, use CDbl instead to convert a string to a
number."
How do I use CDbl in the offending line of code?
Thanks.
Germany. The macro adds columns to check total debits vs.
total credits.
When I run it in the US, it works fine because it sees
50.25. But when the macro runs for one of the German
users, it sees 50,25 and it doesn't use the 25 in
calculating the total.
The reason for the difference is in this line of code:
TotalDebits = TotalDebits + Val(ActiveCell.Offset(0, 5))
According to Help: "The Val function recognizes only the
period (.) as a valid decimal separator. When different
decimal separators are used, as in international
applications, use CDbl instead to convert a string to a
number."
How do I use CDbl in the offending line of code?
Thanks.