如何将多列转换为单列?

我有一个如下所示的表格:

Col1 Col2 Col3 Col4 abcd efgh 

我需要将其转换为:

 Col1 New ab ac ad ef eg eh 

我有大量的数据,手工操作是不可能的。 有谁知道一个快速的方法来做到这一点? 我希望有一个内置的方式(如paste->转置或function?)。 如果没有人可以指点我在一个相关的VBA的例子,因为我在VBA生锈。

select要变换的数据(不包括列标题)并运行下面的macros。

 Sub Transform() Dim targetRowNumber As Long targetRowNumber = Selection.Rows(Selection.Rows.Count).Row + 2 Dim col1 As Variant Dim cell As Range Dim sourceRow As Range: For Each sourceRow In Selection.Rows col1 = sourceRow.Cells(1).Value For Each cell In sourceRow.Cells If Not cell.Column = Selection.Column Then Selection.Worksheet.Cells(targetRowNumber, 1) = col1 Selection.Worksheet.Cells(targetRowNumber, 2) = cell.Value targetRowNumber = targetRowNumber + 1 End If Next cell Next sourceRow End Sub