I have some problems with VBA Autofilling. Please find my code below.
Worksheets("DataSource").Range("E" & ActiveSheet.UsedRange.Rows.Count).End(xlUp).Select
ActiveCell.Offset(1, 0).Value = Worksheets("DataSource").Range("E" & ActiveSheet.UsedRange.Rows.Count).End(xlUp).Value + 1
ActiveCell.Offset(1, 0).Select
ActiveCell.AutoFill Destination:=Worksheets("DataSource").Range(ActiveCell.Address & ":E" & Cells(Rows.Count, "A:A").End(xlUp).Row)
Basically, I want to make this VBA as:
1) +1 from last value in Column E {ex) if E45 was "46", I want to make add E46 as "47"}
2) Select E46(47)
3) Autofill E46(47) until the row that some value exist in A.
To explain a bit more, if A has value until A89, then I want to autofill until row 89, so in this case E89.
Problem now:
Sometimes Autofilling does not work until the last row. Especially, when I run this code again it only works until the middle row.