Q:

Why is VBA changing my decimal format?

I have created a spreadsheet with VBA functions in a PT-BR (comma as decimal) Excel. Everything works fine.
But a client (running it on EN-US) had a weird issue: decimal numbers, such as 3.88888 were copied as hole numbers, like 388888. Numbers with less decimal cases, like 2.5, get copied as 2,5, and not recognized as numbers.
My function is just copying the value, like this: 

ResultsSheet.Cells(row, 3).Value=DataSheet.Cells(row, 11).value

Unfortunately, I am unable to reproduce this issue. On either language setting, I get correct results - which is what I would expect.
Anyone having experienced this, or pointing me to some information would be greatly appreciated. I would also help with clues on how to reproduce my client's issue.

A:

As you said, quite tricky to recreate the problem, but type conversion with some checks should work, snippet below.
If InStr(DataSheet.Cells(Row, 11).Value, ",") > 0 Then
    'check if text contains a comma, and if so replace with "."
    ResultsSheet.Cells(Row, 3).Value = CDec(Replace(DataSheet.Cells(Row, 11).Text, ",", "."))
Else
    If IsNumeric(Cells(r, 11).Value) Then
    'check if numeric and ensure decimal value on ResultsSheet
        ResultsSheet.Cells(Row, 3).Value = CDec(DataSheet.Cells(Row, 11).Text)
    Else
    'if text then just copy
        ResultsSheet.Cells(Row, 3).Value = DataSheet.Cells(Row, 11).Value
    End If
End If

Hope this solves your issue. Boa Sorte ^^.
Miguel

