خرید بک لینک

Vote count: 0

I am finding that the VBA Round function retus the wrong result. I found a working alteative which is to use the Application.Round instead.

Why doesn't the VBA Round function work as expected?

Sub roundingResults()
    Range("A1") = 123456.705
    Debug.Print "Approach #1 " & Round(Range("A1").Value, 2)
    Debug.Print "Approach #2 " & Application.Round(Range("A1").Value, 2)    
End Sub

Output

Approach #1 123456.7
Approach #2 123456.71

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: پنجشنبه 2 ارديبهشت 1395 ساعت: 4:05

صفحه بندی