跳至主要内容

如何在 Excel 中快速将数组表转换为列表表?

Author: Sun Last Modified: 2025-05-07

假设您有一个数组表/交叉表,将这个数组表转换为列表表对您来说可能不是一件难事,您可以通过逐个输入数据来完成转换。然而,如果有多个数组表需要转换为列表表,手动方法肯定不是好的解决方案。现在,本教程介绍了可以快速在 Excel 中将数组表转换为列表表的技巧。

使用数据透视表将数组表转换为列表表

使用 VBA 将数组表转换为列表表

使用 Kutools for Excel 将数组表转换为列表表 good idea3


arrow blue right bubble 使用数据透视表将数组表转换为列表表

您可以应用数据透视表将数组表转换为列表,然后将其复制为区域。

1. 按下 Alt + D 同时按下,然后按 P 键以启用 数据透视表和数据透视图向导 对话框,并勾选 多重合并计算数据区域数据透视表 选项。参见截图:
A screenshot of the PivotTable and PivotChart Wizard dialog in Excel

2. 单击“下一步”进入向导的步骤 2a,并勾选“我将创建页面字段”选项。参见截图:
A screenshot of the Step 2a page fields options in the PivotTable Wizard

3. 单击 下一步 进入 向导的步骤 2b,并选择数组范围并将其添加到 所有范围 列表中。参见截图:
A screenshot of selecting the array range in Step 2b of the PivotTable Wizard

4. 单击 下一步 进入最后一步,根据需要勾选一个选项。参见截图:
A screenshot of the final step of the PivotTable Wizard options

5. 单击 完成 然后会创建一个数据透视表,接着转到 总计的交叉单元格,双击它,您可以看到一个新的工作表中已创建了一个列表数据透视表。参见截图:
A screenshot of the PivotTable with the Grand Total cell double-clicked

6. 然后选择列表数据透视表,右键单击并选择 表格 > 转换为区域 从上下文菜单中。参见截图:
A screenshot of the context menu to convert PivotTable to range in Excel

现在,数组表已转换为列表表。
A screenshot of the list table created from the array table in Excel


arrow blue right bubble 使用 VBA 将数组表转换为列表表

这里有一个 VBA 可以帮助您将数组表转换为列表表,请按照以下步骤操作:

1. 按 Alt + F11 启用 Microsoft Visual Basic for Applications 窗口。

2. 单击 插入 > 模块,并将以下 VBA 代码粘贴到新的模块窗口中。

VBA:将数组表转换为列表

Sub ConvertTableToList()
'UpdatebyEntendOffice20160429
    Dim I As Long
    Dim xCls As Long
    Dim xRg As Range
    Dim xSaveToRg As Range
    Dim xTxt As String
    On Error Resume Next
    xTxt = ActiveWindow.RangeSelection.Address
    Set xRg = Application.InputBox("Select Array Table:", "Kutools for Excel", xTxt, , , , , 8)
    If xRg Is Nothing Then Exit Sub
    Set xSaveToRg = Application.InputBox("Select a range(cell) to put the list table", "Kutools for Excel", , , , , , 8)
    If xSaveToRg Is Nothing Then Exit Sub
    Set xSaveToRg = xSaveToRg.Cells(1)
    xCls = xRg.Columns.Count - 1
    Application.ScreenUpdating = False
    For I = 1 To xRg.Rows.Count
        xSaveToRg.Offset((I - 1) * xCls).Value = xRg.Cells(I, 1).Value
        xSaveToRg.Offset((I - 1) * xCls, 1).Resize(xCls).Value = _
                        Application.WorksheetFunction.Transpose(xRg.Cells(I, 2).Resize(1, xCls))
    Next
    Application.ScreenUpdating = True
End Sub

3. 按下 F5 键运行 VBA,弹出一个对话框供您选择不包括标题的数组表。参见截图:
A screenshot of selecting the array table excluding headers in Excel

4. 单击 确定 进入下一个对话框以选择一个单元格输出列表表。参见截图:
A screenshot of selecting a cell to output the list table in Excel

5. 单击 确定,数组表已转换为列表。
A screenshot of the converted list table in Excel

提示:

如果您想基于上方单元格填充空白单元格,您可以按照以下步骤操作:

1. 安装 Kutools for Excel —— 一个方便的工具,然后单击 Kutools > 插入 > 填充空白单元格。参见截图:
A screenshot of the Kutools Fill Blank Cells option

2. 在 填充空白单元格 对话框中,勾选 基于值向下 选项。参见截图:
A screenshot of the Fill Blank Cells dialog

3. 单击 确定应用,现在空白单元格已基于上方的值进行填充。
A screenshot of filled blank cells in an Excel list table

点击此处了解更多关于填充空白单元格的信息。


arrow blue right bubble 使用 Kutools for Excel 将数组表转换为列表表

如果上述方法对您来说不够简单,这里我可以介绍一个方便的工具 —— Kutools for Excel,其 转换表格维数功能可以快速轻松地在数组表和列表表之间进行转换。

Kutools for Excel配备 AI 🤖,提供超过 300 项实用功能,简化您的任务。

免费安装 Kutools for Excel 后,请按照以下步骤操作:

1. 选择要转换为列表的数组表,并单击 Kutools > 区域 > 转换表格维数。参见截图:
A screenshot of the Kutools Transpose Table Dimensions option in Excel

2. 然后在 转换表格维数 对话框中,勾选二维表转一维表选项,然后选择输出列表表的范围。参见截图:
A screenshot of the Transpose Table Dimensions dialog

3. 单击 确定,现在数组表已转换为列表表。
A screenshot of the list table created from the array table using Kutools

点击此处了解更多关于转换表格维数的信息。

最佳办公效率工具

🤖 Kutools AI 助手:基于智能执行生成代码创建自定义公式分析数据并生成图表调用 Kutools 函数等功能,彻底改变数据分析方式…
热门功能查找、高亮或标记重复项 | 删除空行 | 合并不丢失数据的列或单元格 | 四舍五入 ...
高级 LOOKUP多条件 VLookup | 多值 VLookup | 多表查找 | 模糊查找 ....
高级下拉列表快速创建下拉列表 | 从属下拉列表 | 多选下拉列表 ....
列管理器添加指定数量的列 | 移动列 | 切换隐藏列的可见状态 | 比较区域和列 ...
精选功能网格聚焦 | 设计视图 | 增强编辑栏 | 工作簿与工作表管理器 | 资源库(自动文本) | 日期提取 | 合并数据 | 加密/解密单元格 | 按列表发送电子邮件 | 超级筛选 | 特殊筛选(筛选粗体/斜体/删除线...)...
排名前 15 的工具集12 种文本 工具添加文本删除特定字符等) | 50 多 种图表 类型甘特图等) | 40 多种实用 公式基于生日计算年龄等) | 19 种插入 工具插入二维码根据路径插入图片等) | 12 种转换 工具小写金额转大写汇率转换等) | 7 种合并与分割 工具高级合并行分割单元格等) | 还有更多...

使用 Kutools for Excel 提升您的 Excel 技能,体验前所未有的高效。 Kutools for Excel 提供超过 300 种高级功能来提高生产力并节省时间。 单击此处获取您最需要的功能...


Office Tab 将标签式界面引入 Office,让您的工作更加轻松

  • 在 Word、Excel、PowerPoint 中启用标签式编辑和阅读
  • 在同一窗口的新标签页中打开和创建多个文档,而不是在新窗口中进行操作。
  • 将您的生产力提升 50%,每天为您减少数百次鼠标点击!