Asterix
01-25-2008, 05:17 AM
I declare variable X as single, populate it with a calculated (e.g.) 14.02.
I put it in a cell (the cell says 14.02).
I format the cell as "0.00" (the cell says 14.02).
Later, in another macro, I copy that cell value to another single variable, Y (according to the debugger, the variable says 14.02).
I create a new spreadsheet and format the numbers as "0.00"
I populate one of the cells I just formatted with the variable value, like this...
Worksheets("Overall standings").Cells(driver_row, event_column).Value = Round(score, 2)
The value in the cell now reads (e.g.) "14.01564333756".
I've tried using "round(variable, 2)" on both X and Y (even though I can see they're only 2 dec. places), still no joy.
Funny thing is, if I were to originally assign X a value of (e.g.) 16.5, I don't have the subsequent problem.
Anyone come across similar?
I put it in a cell (the cell says 14.02).
I format the cell as "0.00" (the cell says 14.02).
Later, in another macro, I copy that cell value to another single variable, Y (according to the debugger, the variable says 14.02).
I create a new spreadsheet and format the numbers as "0.00"
I populate one of the cells I just formatted with the variable value, like this...
Worksheets("Overall standings").Cells(driver_row, event_column).Value = Round(score, 2)
The value in the cell now reads (e.g.) "14.01564333756".
I've tried using "round(variable, 2)" on both X and Y (even though I can see they're only 2 dec. places), still no joy.
Funny thing is, if I were to originally assign X a value of (e.g.) 16.5, I don't have the subsequent problem.
Anyone come across similar?