I have several columns that I wish to put into one. Right now I am stuck with copying and pasting them into one column, is there a quicker way of doing this?
Any help hugely appreciated
I have several columns that I wish to put into one. Right now I am stuck with copying and pasting them into one column, is there a quicker way of doing this?
Any help hugely appreciated
If you have excel, you could use VBA.
.
Sub CombineColumns()
Dim xRng As Range
Dim i As Integer
Dim xLastRow As Integer
Dim xTxt As String
On Error Resume Next
xTxt = Application.ActiveWindow.RangeSelection.Address
Set xRng = Application.InputBox("please select the data range", "Select range", xTxt, , , , , 8)
If xRng Is Nothing Then Exit Sub
xLastRow = xRng.Columns(1).Rows.Count + 1
For i = 2 To xRng.Columns.Count
Range(xRng.Cells(1, i), xRng.Cells(xRng.Columns(i).Rows.Count, i)).Cut
ActiveSheet.Paste Destination:=xRng.Cells(xLastRow, 1)
xLastRow = xLastRow + xRng.Columns(i).Rows.Count
Next
End Sub
Then press F5 key to run this code, and a prompt box will pop out to remind you select the data range that you want to combine into only one column.
And then click OK button, and the selected columns have been merged into only one column.
Tips: After running this VBA, the original data of the range will be cleared, you’d better copy and save them in another location first.