close

why does this code not input a formula into cells
e5 to end of data

Range(quot;D6quot;).Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, 1).Range(quot;A1quot;).Select
Do Until Range(quot;E5quot;).Select
ActiveCell.FormulaR1C1 = quot;=R2C8/(RC[-2]-RC[-4])quot;
ActiveCell.Offset(-1, 0).Range(quot;a1quot;).Select
LoopHi agw,

Try the following change:Do Until ActiveCell.Address = quot;$E$5quot;

Ken JohnsonIt looks like you're using column D to get the last used cell.

If that's true:

with activesheet
.range(quot;E5:Equot; amp; .cells(.rows.count,quot;Dquot;).end(xlup).row).formular1c1 _
= quot;=R2C8/(RC[-2]-RC[-4])quot;
end with
wrote:
gt;
gt; why does this code not input a formula into cells
gt; e5 to end of data
gt;
gt; Range(quot;D6quot;).Select
gt; Selection.End(xlDown).Select
gt; ActiveCell.Offset(0, 1).Range(quot;A1quot;).Select
gt; Do Until Range(quot;E5quot;).Select
gt; ActiveCell.FormulaR1C1 = quot;=R2C8/(RC[-2]-RC[-4])quot;
gt; ActiveCell.Offset(-1, 0).Range(quot;a1quot;).Select
gt; Loop
gt;

--

Dave Peterson

全站熱搜
創作者介紹
創作者 software 的頭像
software

software

software 發表在 痞客邦 留言(0) 人氣()