View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
DA[_2_] DA[_2_] is offline
external usenet poster
 
Posts: 50
Default Simple macro, even simpler programmer!

I'm trying to paste the value of one calculated cell onto another that
just has a vlaue unitl they are essentially the same. The macro below
seems to only iterate once, whereas it usually take three or fout
iterations to get them close. So, clearly something is wrong. Please
help.

Thanks
Dean

Sub Iterate_On_Cost()

Dim Difference As Variant
Dim CalculatedCost As Variant
Dim HardCodedCostValue As Variant


Do
Range("CalculatedCost").Select
Selection.Copy
Range("HardCodedCostValue").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Difference = Abs(CalculatedCost - HardCodedCostValue)
Loop Until Difference < 0.001

End Sub