macro to copy down the values while the adjacent cell be NOT empty

H

Hernan

Hi, thank you for help me!
I have 2 columns and I need to copy down the value in the first-one
until the adjacent column be empty.
I can't define any range because the list will vary every time.
¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬
name1 1
? 2
? 3
? 4
? 5
. 6
. 7
. 8
¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬

I was thinking in something like:
i = 0
For Each cellA In rA
For Each cellB In rB
i = i + 1
.Cells(i, 3) = cellA
.Cells(i, 4) = cellB
 
G

Gord Dibben

Sub Auto_Fill()
Dim Lrow As Long
With ActiveSheet
Lrow = Range("B" & Rows.Count).End(xlUp).Row
Range("A1:A" & 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