Suppose that I have the following numbers in Notepad:
1.19
0.040
10.1123
23.110
21.223
2.35456
4.0
10234.0009
456798.7500
123
34.560
40060
33.7876
If I copy the numbers and paste them in Excel, the numbers will change to this:
1.19
0.04
10.1123
23.11
21.223
2.35456
4
10234.0009
456798.75
123
34.56
40060
33.7876
I want to copy-paste the numbers without changing their original format, for example:
- 0.040, not 0.04
- 4.0, not 4
- 456798.7500, not 456798.75
I'm aware that I can use conditional formatting like
If condition_1 Then
Cells(...).NumberFormat = "0.00"
ElseIf condition_2 Then
Cells(...).NumberFormat = "0.000"
...
Else
result_else
End If
or use Select ... Case Statement, but the problems with these methods are:
- The code can be lengthy and looks messy.
- If the numbers change, then the conditionals must change, too.
So my question is:
How to make Excel not truncate the zeroes at the end of decimal numbers?
I want to keep the values as numbers, not text.
This kind of representation does matter in financial data for example: foreign exchange or currency rate.