I am trying to find out how to fill down (or copy?) a row (lastUsedRow
) up to the last row. However I find myself struggling with designating ranges (especially because I am working on different datasets that have different sizes).
Before
I need to spot the lastUsedRow
(lastUsedRow = .Range("A" & .Rows.Count).End(xlUp).Row
) - which is row 31 here. It designates the latest row where there was data in column A.
Then I want to tell VBA to fill down until the last row (lastRow
) - row 39 - which can be found using lastRow = .Range("E" & .Rows.Count).End(xlUp).Row
. It designates the latest row where there was data in column E.
After
Question
VBA recommends to work with Range().FillDown
but I struggle with designating the range when coding for changing datasets. More precisely, how to I write down a range that is between lastUsedRow
and lastRow
?