An interesting bug is reported at Daily Dose of Excel:
Code snipit to test
If you use a variable of data type currency as a counter in VBA you get some very strange behaviour. The function below returns the result of counting between the specified limits:
Function CheckCurrency(startval, endval)
Dim c As Currency
For c = startval To endval
Next c
CheckCurrency = c
End Function
The function should return a value one greater than “endval”, but the screen shot below shows the results of using currency as a counter:
Just to prove it is the currency data type causing the problem, here are the results of the same function, with the counter changed to a long:
The message is, don’t count on currency.