Just thought I'd add my current solution. Since what I was looking for was to copy the formulas from three cells down a row, I changed the two lines of code to the following three lines. It appears to have solved the problem. I would still like to get any ideas as to why the other two lines of code get a server exception.
Thanks.
wkbStartData.Worksheets("Unit " & CStr(i + 1)).Range("R" & _
txtWorkRow).Value = "=(E" & txtWorkRow & "*$E$2+F" & txtWorkRow _
& "*$F$2+G" & txtWorkRow & "*$G$2+H" & txtWorkRow & "*$H$2+I" & _
txtWorkRow & "*$I$2+J" & txtWorkRow & "*$J$2+K" & txtWorkRow _
& "*$K$2)*IF(M" & txtWorkRow & ">0,P" & txtWorkRow & ",1)"
wkbStartData.Worksheets("Unit " & CStr(i + 1)).Range("S" & _
txtWorkRow).Value = "=IF(M" & txtWorkRow & ">0,Q" & txtWorkRow_
& "*(E" & txtWorkRow & "*$E$2+F" & txtWorkRow & "*$F$2+G" & _
txtWorkRow & "*$G$2+H" & txtWorkRow & "*$H$2+I" & txtWorkRow _
& "*$I$2+J" & txtWorkRow & "*$J$2+K" & txtWorkRow & "*$K$2),(E"_
& txtWorkRow & "*$E$2+F" & txtWorkRow & "*$F$2+G" & txtWorkRow_
& "*$G$2+H" & txtWorkRow & "*$H$2+I" & txtWorkRow & "*$I$2+J" &_
txtWorkRow & "*$J$2+K" & txtWorkRow & "*$K$2))"
wkbStartData.Worksheets("Unit " & CStr(i + 1)).Range("T" & _
txtWorkRow).Value = "=IF(R" & txtWorkRow & "=0,0,D" & txtWorkRow_
& "/R" & txtWorkRow & ")"
Thanks,
Ray
|