Hiya,
I am a novice in VBA (this is day 2) and wanted to write a script to copy some values from sheet to another and fill down to the last filled row. This is what I have so far:
Dim lRow As Long
lRow = Worksheets("Data").Cells(Worksheets("Data").Rows.Count, "A").End(xlUp).Row
lRow = lRow + 1
Worksheets("Summary").Select
Range("A12:G19").Copy
Worksheets("Data").Select
Range("A" & lRow).PasteSpecial xlPasteValues
Worksheets("Summary").Select
Range("A4").Copy
Worksheets("Data").Range("H" & lRow).PasteSpecial xlPasteValues
Its the value in column H that I want to paste/fill down to the last filled row but I'm getting no joy.
Tried this - ActiveCell.AutoFill ActiveCell.Resize(Lastrow - ActiveCell.Row + 1) from a different thread as well as
ActiveCell.AutoFill Destination:=Range(ActiveCell, Cells(Cells(Rows.Count, "B").End(xlUp).Row, "C"))
but no joy - the last one partly worked but the number in column H was increasing incrementally. I wanted it to remain the same.
Help please
I am a novice in VBA (this is day 2) and wanted to write a script to copy some values from sheet to another and fill down to the last filled row. This is what I have so far:
Dim lRow As Long
lRow = Worksheets("Data").Cells(Worksheets("Data").Rows.Count, "A").End(xlUp).Row
lRow = lRow + 1
Worksheets("Summary").Select
Range("A12:G19").Copy
Worksheets("Data").Select
Range("A" & lRow).PasteSpecial xlPasteValues
Worksheets("Summary").Select
Range("A4").Copy
Worksheets("Data").Range("H" & lRow).PasteSpecial xlPasteValues
Its the value in column H that I want to paste/fill down to the last filled row but I'm getting no joy.
Tried this - ActiveCell.AutoFill ActiveCell.Resize(Lastrow - ActiveCell.Row + 1) from a different thread as well as
ActiveCell.AutoFill Destination:=Range(ActiveCell, Cells(Cells(Rows.Count, "B").End(xlUp).Row, "C"))
but no joy - the last one partly worked but the number in column H was increasing incrementally. I wanted it to remain the same.
Help please