Hi All,
I have been working on the following code which selects all the values in column A (rng1).
I then have it go to the last cell of the data in column D and select the next blank available row.
What I am stuck on as I want each value from the rng1 to be put in the next cell to the right in column D, so the first A1 value would go into the first available blank cell in column D, A2 value would go into E, A3 would go into F etc...
At the moment the script is just putting the last value of column A into the blank cell in column D.
I have been working on the following code which selects all the values in column A (rng1).
I then have it go to the last cell of the data in column D and select the next blank available row.
What I am stuck on as I want each value from the rng1 to be put in the next cell to the right in column D, so the first A1 value would go into the first available blank cell in column D, A2 value would go into E, A3 would go into F etc...
At the moment the script is just putting the last value of column A into the blank cell in column D.
Code:
Sub test1()
Dim rng1 As Range
Range("A" & Rows.Count).End(xlUp).Select
Set rng1 = Selection
Range("D" & Rows.Count).End(xlUp).Select
ActiveCell.Offset(1, 0).Select
With rng1
Dim cell As Range
For Each cell In Selection.Cells
If cell.HasFormula = False Then
End If
ActiveCell.Value = rng1.Value
ActiveCell.Offset(0, 1).Select
Next
End With
End Sub