vba code

G

Guest

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

Range("D6").Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, 1).Range("A1").Select
Do Until Range("E5").Select
ActiveCell.FormulaR1C1 = "=R2C8/(RC[-2]-RC[-4])"
ActiveCell.Offset(-1, 0).Range("a1").Select
Loop
 
K

Ken Johnson

Hi agw,

Try the following change:


Do Until ActiveCell.Address = "$E$5"

Ken Johnson
 
D

Dave Peterson

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

If that's true:

with activesheet
.range("E5:E" & .cells(.rows.count,"D").end(xlup).row).formular1c1 _
= "=R2C8/(RC[-2]-RC[-4])"
end with

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

Range("D6").Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, 1).Range("A1").Select
Do Until Range("E5").Select
ActiveCell.FormulaR1C1 = "=R2C8/(RC[-2]-RC[-4])"
ActiveCell.Offset(-1, 0).Range("a1").Select
Loop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top