Originally Posted by
psauber
I need to copy the contents of Row 1 Column X and Column XX
down by 5 or 6 lines depending on how many rows there are.
Example is attached since it doesn't format properly typing it
here
Contents of columns D & E need to be copied down into 5 cells.
However, sometimes columns D & E could be E & F or C & D
Thanks for any help
You don't say how you will know which columns to copy down, so I have assumed you will activate either of the cells, D2 or E2 in your example.
Sub CopyDown()
Dim rng As Range
With ActiveCell
If .Offset(1, 1).Value = "" Then
Set rng = Cells(2, .Column).Resize(, 2)
Else
Set rng = Cells(2, .Column).Offset(0, -1).Resize(, 2)
End If
End With
rng.AutoFill rng.Resize(Cells(Rows.Count, "A").End(xlUp).Row - 1)
End Sub