ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Filldown Problem (https://www.excelbanter.com/excel-programming/323898-filldown-problem.html)

juan

Filldown Problem
 
Hello All,
can't seem to get the following to work properly. Here's
my 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
This doesn't work. It leaves K15 empty, but L15 seems to
get sum up. When I pu Xldown.row, this works but copies
alll the way down.
So basically in Column K15 copy contents of Column A and
filldown to last row of data in column A same thing with
Column O copy in L15 and filldown. I have a formula in
Column O so I don't want the formula or just value, since
when I update my formula, want those totals updated in L15.
Hope I'm explaining this right.

Thanks for any help provided.

Juan

Jim Cone

Filldown Problem
 
Juan,

It works for me.
However, it leaves Column K blank if there is no data in Column A below row 15.
Also, the line "Dim LastRow1 as Long should not be commented out.

Regards,
Jim Cone
San Francisco, USA

"Juan" wrote in message
...
Hello All,
can't seem to get the following to work properly. Here's
my 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
This doesn't work. It leaves K15 empty, but L15 seems to
get sum up. When I pu Xldown.row, this works but copies
alll the way down.
So basically in Column K15 copy contents of Column A and
filldown to last row of data in column A same thing with
Column O copy in L15 and filldown. I have a formula in
Column O so I don't want the formula or just value, since
when I update my formula, want those totals updated in L15.
Hope I'm explaining this right.
Thanks for any help provided.
Juan


juan

Filldown Problem
 
Hello Jim
thanks. But not sure if I'm explaining it right. For my
example, there is no data below A8. When I use this same
logic on a different sheet and reference my data sheet,
it works.
So need to copy range in column A and range of Column O
to the last row of data.

Please advise if anyother info.

Thanks,

Juan

-----Original Message-----
Juan,

It works for me.
However, it leaves Column K blank if there is no data in

Column A below row 15.
Also, the line "Dim LastRow1 as Long should not be

commented out.

Regards,
Jim Cone
San Francisco, USA

"Juan" wrote in message
...
Hello All,
can't seem to get the following to work properly.

Here's
my 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
This doesn't work. It leaves K15 empty, but L15 seems

to
get sum up. When I pu Xldown.row, this works but

copies
alll the way down.
So basically in Column K15 copy contents of Column A

and
filldown to last row of data in column A same thing

with
Column O copy in L15 and filldown. I have a formula in
Column O so I don't want the formula or just value,

since
when I update my formula, want those totals updated in

L15.
Hope I'm explaining this right.
Thanks for any help provided.
Juan

.


Jim Cone

Filldown Problem
 
Juan,

Try the following code on a blank sheet.
Try it with LastRow = 8 and with LastRow = 20

'------------------------
Sub TestFillRange()
Dim LastRow
Range("K15").Value = "Test"
LastRow = 8 'or 20
Range("K15:K" & LastRow).FillDown
End Sub
'------------------------

Regards,
Jim Cone
San Francisco, USA



"Juan" wrote in message
...
Hello Jim
thanks. But not sure if I'm explaining it right. For my
example, there is no data below A8. When I use this same
logic on a different sheet and reference my data sheet,
it works.
So need to copy range in column A and range of Column O
to the last row of data.
Please advise if anyother info.
Thanks,
Juan



-----Original Message-----
Juan,
It works for me.
However, it leaves Column K blank if there is no data in

Column A below row 15.
Also, the line "Dim LastRow1 as Long should not be

commented out.
Regards,
Jim Cone
San Francisco, USA




"Juan" wrote in message
...
Hello All,
can't seem to get the following to work properly.

Here's
my 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
This doesn't work. It leaves K15 empty, but L15 seems

to get sum up. When I pu Xldown.row, this works but
copies alll the way down.
So basically in Column K15 copy contents of Column A

and filldown to last row of data in column A same thing
with Column O copy in L15 and filldown. I have a formula in
Column O so I don't want the formula or just value,

since when I update my formula, want those totals updated in
L15. Hope I'm explaining this right.
Thanks for any help provided.
Juan



JUAN

Filldown Problem
 
Hello Jim,
thanks. I tried but did not work. The filldown is seem to
be not working. I will repost just in case. I really do
appreciate all your help.

Once again thanks,

juan
-----Original Message-----
Juan,

Try the following code on a blank sheet.
Try it with LastRow = 8 and with LastRow = 20

'------------------------
Sub TestFillRange()
Dim LastRow
Range("K15").Value = "Test"
LastRow = 8 'or 20
Range("K15:K" & LastRow).FillDown
End Sub
'------------------------

Regards,
Jim Cone
San Francisco, USA



"Juan" wrote in message
...
Hello Jim
thanks. But not sure if I'm explaining it right. For my
example, there is no data below A8. When I use this

same
logic on a different sheet and reference my data sheet,
it works.
So need to copy range in column A and range of Column O
to the last row of data.
Please advise if anyother info.
Thanks,
Juan



-----Original Message-----
Juan,
It works for me.
However, it leaves Column K blank if there is no data

in
Column A below row 15.
Also, the line "Dim LastRow1 as Long should not be

commented out.
Regards,
Jim Cone
San Francisco, USA




"Juan" wrote in message
...
Hello All,
can't seem to get the following to work properly.

Here's
my 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
This doesn't work. It leaves K15 empty, but L15

seems
to get sum up. When I pu Xldown.row, this works but
copies alll the way down.
So basically in Column K15 copy contents of Column A

and filldown to last row of data in column A same

thing
with Column O copy in L15 and filldown. I have a

formula in
Column O so I don't want the formula or just value,

since when I update my formula, want those totals

updated in
L15. Hope I'm explaining this right.
Thanks for any help provided.
Juan


.



All times are GMT +1. The time now is 09:42 AM.

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