Skip to main content

如何在 Excel 中快速將陣列表格轉換為清單表格?

Author: Sun Last Modified: 2025-05-12

假設您有一個陣列表格/交叉表格,將這個陣列表格轉換為清單表格對您來說可能不是一件困難的事,您可以逐一手動輸入數據來完成轉換。然而,如果有許多陣列表格需要轉換為清單表格,手動方法肯定不是一個好的解決方案。現在,本教程介紹了一些技巧,可以快速將陣列表格轉換為清單表格。

使用樞紐分析表將陣列表格轉換為清單表格

使用 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 個插入工具插入QR碼根據路徑插入圖片、...)   |   12 個轉換工具金額轉大寫匯率轉換、...)   |   7 個合併與分割工具高級合併行分割儲存格、...)   |   ... 還有更多

使用 Kutools for Excel 提升您的 Excel 技巧,體驗前所未有的高效。 Kutools for Excel 提供超過 300 種高級功能來提高生產力並節省時間。  點擊這裡獲取您最需要的功能...


Office Tab 將標籤式界面帶到 Office,讓您的工作更加輕鬆

  • 在 Word、Excel、PowerPoint、Publisher、Access、Visio 和 Project 中啟用標籤式編輯和閱讀。
  • 在同一窗口的新標籤中打開和創建多個文檔,而不是在新窗口中。
  • 將您的生產力提高 50%,每天為您減少數百次鼠標點擊!