ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can't seem to get to fill down (https://www.excelbanter.com/excel-programming/323973-cant-seem-get-fill-down.html)

juan

Can't seem to get to fill down
 
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

Glen Mettler[_4_]

Can't seem to get to fill down
 
This will work:

Range(myrange).select
selection.filldown

Glen

"jUAN" wrote in message
...
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




Chip[_3_]

Can't seem to get to fill down
 
What are you trying to do here conceptually, because it appeard there
may be several flaws in your code?


juan

Can't seem to get to fill down
 
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" wrote in message
...
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



.


Chip[_3_]

Can't seem to get to fill down
 
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....



All times are GMT +1. The time now is 06:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com