(Solved) – Excel VBA Macro to autofill (ie. filldown) AFTER last row to the next blank row?


I currently have data that I require to count down with the rows. The problem is that the column of data (Column A) contains both letters and numbers (as per image).
Image 1

I figured that the simplest way around this is by using the either the filldown/autofill function. Essentially: find the end of the data and autofill to the next blank cell in the row below.

Should be simple, right? That’s what I thought! I have tried EVERYTHING I can think of.

Currently, my VBA code looks like this:

Dim LastRow, currentCol As Long
currentCol = 1 'change to whatever row you want to work with
With ActiveSheet
    LastRow = .Cells(.Rows.Count, currentCol).End(xlDown).Row
End With

Cells(LastRow, currentCol).AutoFill Destination:=Range(Cells(LastRow, currentCol), Cells(LastRow, currentCol).Offset(1, 0)), Type:=xlFillDefault

End Sub

If you have any fixes or alternatives, I would greatly appreciate the help

Leave a Reply

Your email address will not be published. Required fields are marked *