starl
Administrator
- Joined
- Aug 16, 2002
- Messages
- 6,091
- Office Version
- 365
- Platform
- Windows
I have two cells I compare (via VBA). Both cells are in pivot tables.
Both values appear to match, down to the decimal of .295.
I've used a simple = formula and Excel says they match.
I used format cells to extend the decimal as far as it can and I do not see any extra numbers.
Via VBA, I Round them to 2 decimals. And that's where the problem starts.
One value rounds to .3
The other values rounds to .29
Now the values no longer match..
Why are the values changing when rounded?
The variables are declared as Double
thanks
Both values appear to match, down to the decimal of .295.
I've used a simple = formula and Excel says they match.
I used format cells to extend the decimal as far as it can and I do not see any extra numbers.
Via VBA, I Round them to 2 decimals. And that's where the problem starts.
One value rounds to .3
The other values rounds to .29
Now the values no longer match..
Why are the values changing when rounded?
The variables are declared as Double
thanks