PDA

View Full Version : Issues with using autofill in vb macro



mcronin
09-10-2018, 12:51 PM
Hi,

I have a macro I am running to generate a report.

Basically, my macro takes a value from another tab, counts the rows and pastes that value in the next cell down. I want to then go back to that cell and autofill down. I have the below code that seems to work for the first iteration, but then stops working past the first time. Any ideas of how I can make this work? The line in italics is where I am getting stuck.

Cells(Rows.Count, 2).End(xlUp).Offset(0, 0).Select
cell = ActiveCell.Address


Selection.AutoFill Destination:=Range(cell, "B20000")


Cells(Rows.Count, 3).End(xlUp).Offset(0, 0).Select
cell3 = ActiveCell.Address


Selection.AutoFill Destination:=Range(cell3, "C20000")

Thanks in advance for any help you can give!

mancubus
09-12-2018, 07:47 AM
welcome to the forum.

post your workbook pls.
care to provide 'before macro (original table)' and 'after macro (manually do what expect the macro will do)' tables' structures.