方法:使用VBA
可以使用下面的代码合并所选单元格:
Sub MergeCells()
'连接所选单元格中的所有内容并将其放入最上方单元格
'然后合并所有单元格
Dim strOutput As String
Dim rng As Range
Const delim = " "
On Error Resume Next
For Each rng In Selection
strOutput = strOutput & rng.Value & delim
Next rng
With Selection
.Clear
.Cells(1).Value = strOutput
.Merge
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlCenter
.WrapText = True
End With
End Sub