Can't seem to get to fill down

J

jUAN

Hello All,
k, I can't seem to get this to work tried everything I
could think but still not working. I have followig code:
Dim LastRow as Long
Dim LastRow1 as Long
LastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
Lastrow1 = ActiveSheet.Cells(Rows.Count, "O").End(xlUp).Row
Range("K15").Select
ActiveCell.FormulaR1C1 = "=R[-14]C[-10]"
Range("K15:K" & LastRow).Filldown
Range("L15").Select
ActiveCell.FormulaR1C1 = "=R[-14]C[3]"
Range("L15:L" & Lastrow1).Filldown
But nothing gets copied. If I change End(xlUp) to Xldown,
it does work, but as u know it copies all the way down.
So not sure what I'm doing wrong. So seems the filldown
not working. So need somethign like:

Any suggestions how I can fix this?
Thanks for any help provided.
Juan
 
C

Chip

What are you trying to do here conceptually, because it appeard there
may be several flaws in your code?
 
J

JUAN

Hello Glen/Chip,
where do i put that part of the code? Basically here's
portion of what table looks like
A B C etc o
Prod Per 1 per 2 etc thru 12 =OFFSET(A1,0,$P$1)
prod1 the above i copied down.
prod2 to last row of data
etc
Total prod

So what I want is in column K15 L15
=A1 =O1
and copy down to last row as it correspond.
I can do it manually but trying to automate it because I
need to do same thing on other sheets.
Hope i'm explaining this right.
Thanks for the help
Juan
-----Original Message-----
This will work:

Range(myrange).select
selection.filldown

Glen

jUAN said:
Hello All,
k, I can't seem to get this to work tried everything I
could think but still not working. I have followig code:
Dim LastRow as Long
Dim LastRow1 as Long
LastRow = ActiveSheet.Cells(Rows.Count, "A").End (xlUp).Row
Lastrow1 = ActiveSheet.Cells(Rows.Count, "O").End (xlUp).Row
Range("K15").Select
ActiveCell.FormulaR1C1 = "=R[-14]C[-10]"
Range("K15:K" & LastRow).Filldown
Range("L15").Select
ActiveCell.FormulaR1C1 = "=R[-14]C[3]"
Range("L15:L" & Lastrow1).Filldown
But nothing gets copied. If I change End(xlUp) to Xldown,
it does work, but as u know it copies all the way down.
So not sure what I'm doing wrong. So seems the filldown
not working. So need somethign like:

Any suggestions how I can fix this?
Thanks for any help provided.
Juan


.
 
C

Chip

Hey Juan i was out of town so i missed this...if you need to autofill
stuff, you dont need to copy down..just go to the bottom right corner
of the cell you want to copy downards and when your cursors changes to
a plus sign...double click....
 

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

Similar Threads


Top