Why does the Format command in Excel VBA perform differently on two different computers?

Mikael Björling 0 Reputation points
2023-04-24T22:02:46.6433333+00:00

I have an Excel VBA code in an older macro that performs differently on two different computers, but I do not why that is. An input string A is "27.67" and the code says B=Format(A). In one computer the result is a number B that can be used in calculations with the value as given by the string. On the second computer, the numeric value becomes "2767" so the decimal point is not correctly treated. Can anyone explain what I must do to make the code work on both computers?

Microsoft 365 and Office | Development | Other
Microsoft 365 and Office | Excel | For business | Windows
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.