Thread: Formula problem
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel[_710_] joel[_710_] is offline
external usenet poster
 
Posts: 1
Default Formula problem


Check the formula on the worksheet to see if it is correct. I think
your code could of been producing a formula which would cause a circular
calculation. It depends on the data in the worksheet. the code below
is much easier to debug.


Set FirstCell = Cells(s - 1, "C").end(xlup)
Set LastCell = Cells(s - 1, "C")
Set SumRange = Range(FirstCell,LastCell)
Set ColA_Range = _
Range(Range("A" & FirstCell.Row),Range("A" & LastCell.Row))
Cells(s, 3).Formula = "=SUM(" & Sumrange.Address & ")-" & _
"SUMIF(" ColA_Range.address &",""CF Total""," & _
SumRange.Address ")"


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=181718

Microsoft Office Help