AutoFill

D

dwake

I would like a macro to be able to autofill a row when I import data. The
problem I'm facing, is the amount of rows will always be changing. I was
hoping there was a code that would fill until the end of the data. Any
suggestions would be appreciated.
 
G

Gord Dibben

Autofill a row or column?

Sounds like the latter to me since part of description says "the amount of
rows will always be changing".

Do you want to fill down to end of data in an adjacent column?

What do you want to fill down with?

Let's say you entered a formula like =A1*B1 in C1 and wanted to fill down
as far as there was data in column B.

Sub Auto_Fill()
Dim lRow As Long
With ActiveSheet
lRow = .Range("B" & Rows.Count).End(xlUp).Row
.Range("C1:C" & lRow).FillDown
End With
End Sub


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top