View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Ron[_32_] Ron[_32_] is offline
external usenet poster
 
Posts: 36
Default Does Excel have a counting glitch? or is it more likely me?

Thanks George (& Don)


I know there are a few ways to do what I'm trying, this isn't why I
posted or what I want to know.

If we start with the variable myFigure at 1.05. The code runs and the
code generates the new myFigure variable. There is no input from
outside whatsoever during run time in this piece of code.

If the code, and only the code, generates the myFigure variable and then
places it in a cell, why cant it find it's own product in the next
instance of the loop?

It generates, and then subsequently finds it's own product upto and
including 1.12 but it then generates 1.13 and plonks the value in the
relevant cell. But here's my beef......why can't it look for and find
the value it has just created itself? regardless of absolute values or
decimal places?

Can anyone answer this?


Ron




















"George Nicholson" wrote in
:


You might try:
Do Until Round(ActiveCell.Value,2) = myFigure
just in case your worksheet values have precision beyond what is being
displayed, thereby "not matching" myFigure.

or, rather than going for a 100% exact match, maybe go for "close
enough". Something like
Do Until abs(ActiveCell.Value - myFigure) =< 0.01

HTH,