当前位置: 代码迷 >> Office >> excel合拢单元格 得到所有数据
  详细解决方案

excel合拢单元格 得到所有数据

热度:6873   发布时间:2013-02-26 00:00:00.0
excel合并单元格 得到所有数据
excel合并单元格如何得到所有数据?并显示在原来的单元格中, 默认的 合并单元格只保留最左边的数据。
------解决方案--------------------------------------------------------
用VBA吧


Sub MergeRanges()
    Dim rng As Range, txt As String
    For Each rng In Selection
        txt = txt & rng.Value2
    Next
    Application.DisplayAlerts = False
    Selection.Merge
    Selection = txt
    Application.DisplayAlerts = True
End Sub
  相关解决方案