跳到主要內容

如何在Excel中將一個單元格轉換為多個單元格/行?

有時,如果Excel單元格中有很多數據,則很難查看所有數據。 在這種情況下,將該單元格中的所有數據轉換為多個單元格或行可以使查看長內容變得更加容易和清晰,如下所示。 在Excel中,您可以通過以下方法完成此操作。

在Excel中使用“文本到列”和“選擇性粘貼”將一個單元格轉換為多個單元格/行

使用VBA將一個單元轉換為多個單元/行

使用Kutools for Excel將一個單元格轉換為多列/行 好主意3


箭頭藍色右氣泡 在Excel中使用“文本到列”和“選擇性粘貼”將一個單元格轉換為多個單元格/行

1.選擇要轉換其數據的單元格,然後單擊 數據 > 文字至欄,請參見屏幕截圖:

2.在彈出對話框中,選中 分隔 複選框,然後單擊 下一頁。 看截圖:

3。 檢查 逗號 僅在對話框中選中復選框,然後單擊 。 看截圖:

4.然後,您可以看到單元格數據已分為多列。 現在選擇這些單元格,然後單擊鼠標右鍵單擊 複製 從上下文菜單複制它們。 看截圖:

5.選擇所需的空白單元格,然後右鍵單擊以選擇 轉置(T),那麼您可以看到數據已轉換為多行。 看截圖:

如果您使用的是Microsoft Excel 2007,請單擊 首頁 > > 顛倒 粘貼拆分數據。

您可以看到如下所示的結果:


根據定界符快速將一個單元格拆分為列或行

在Excel中,使用嚮導逐步將單元格拆分為列很麻煩。 但是隨著 Excel的Kutools's 分裂細胞 實用程序,您可以:1,根據定界符將一個單元格轉換為列或行; 2,將字符串轉換為文本和數字; 3,根據具體的寬度,點擊轉換字符串。  點選取得全功能 30 天免費試用!
doc拆分單元格
 
Kutools for Excel:擁有300多個便捷的Excel加載項,可以在30天內免費試用。

箭頭藍色右氣泡 使用VBA將一個單元轉換為多個單元/行

如果您認為上述方法有點繁瑣,則可以使用VBA來完成。

1。 保持 ALT 按鈕並按下 F11 在鍵盤上打開一個 Microsoft Visual Basic應用程序 窗口。

2。 點擊 插入 >模塊,然後將VBA複製到模塊中。

VBA:將一個單元格轉換為多行

Sub TransposeRange()
'Updateby20140312
Dim rng As Range
Dim InputRng As Range, OutRng As Range
xTitleId = "KutoolsforExcel"
Set InputRng = Application.Selection.Range("A1")
Set InputRng = Application.InputBox("Range(single cell) :", xTitleId, InputRng.Address, Type:=8)
Set OutRng = Application.InputBox("Out put to (single cell):", xTitleId, Type:=8)
Arr = VBA.Split(InputRng.Range("A1").Value, ",")
OutRng.Resize(UBound(Arr) - LBound(Arr) + 1).Value = Application.Transpose(Arr)
End Sub

3。 點擊 運行VBA代碼, Kutoolsfor Excel 彈出對話框,供您選擇要轉換其數據的單個單元格。 看截圖:

4。 點擊 OK,然後在另一個彈出對話框中選擇一個單元格以輸出結果。 看截圖:

您可以看到結果:

尖端:在上面的VBA代碼中,您可以更改分隔符 “,” 您希望將數據分開。 此VBA不支持基於換行符的拆分單元格。


箭頭藍色右氣泡 使用Kutools for Excel將一個單元格轉換為多列/行

如果你有 Excel的Kutools -安裝了方便的工具,您可以使用它 分裂細胞 可以根據定界符快速將單個單元格拆分為多列或多行。

Excel的Kutools:便捷的Excel加載項工具,使您的工作更加輕鬆和高效。
  • 300+ 功能強大且易於使用的功能,110,000+ Excel用戶的選擇
  • 功能齊全 30 天免費試用,無需信用卡
  • 多種一鍵式功能,可縮短您解決複雜問題的時間
  • 包括批量轉換,刪除,合併工作表/單元格,展開等功能,現在免費嘗試。

安裝後 Kutools for Excel,請執行以下操作:(立即免費下載Kutools for Excel!)

1.選擇要拆分為行的單元格,然後單擊 庫工具 > 合併與拆分 > 分裂細胞。 看截圖:
doc kutools分割儲存格1

2.然後在 分裂細胞 對話框,檢查 拆分為行 選項下 類別 部分,並檢查 其他 選項下 指定分隔符 部分,然後在文本框中輸入您要分割單元格的定界符。 看截圖:

文檔庫工具 2

3。 點擊 Ok,然後會彈出一個對話框,提醒您選擇一個單元格以輸出拆分結果。
文檔3

4。 點擊 OK。 現在您可以看到一個單元格已轉換為多行。
doc kutools分割儲存格4

小提示: 如果要基於特定定界符將單個單元格轉換為列,請檢查 拆分為列 對話框中的選項,然後將定界符輸入到 其他 文本框。

箭頭藍色右氣泡 將一個單元格轉換成多行或多列


快速將交叉表移至列表,反之亦然

當您收到需要轉換為列表的帶有交叉表的工作表時,如何快速處理呢? 用 Excel的Kutools 轉置台尺寸 實用程序,您可以盡快將橫尺寸表轉換為三個尺寸表,反之亦然。   點擊即可獲得 30 天全功能免費試用!
doc轉置到列表
 
Kutools for Excel:擁有300多個便捷的Excel加載項,可以在30天內免費試用。

相關文章:

最佳辦公生產力工具

🤖 Kutools 人工智慧助手:基於以下內容徹底改變數據分析: 智慧執行   |  生成代碼  |  建立自訂公式  |  分析數據並產生圖表  |  呼叫 Kutools 函數...
熱門特色: 尋找、突出顯示或識別重複項   |  刪除空白行   |  合併列或儲存格而不遺失數據   |   沒有公式的回合 ...
超級查詢: 多條件VLookup    多值VLookup  |   跨多個工作表的 VLookup   |   模糊查詢 ....
高級下拉列表: 快速建立下拉列表   |  依賴下拉列表   |  多選下拉列表 ....
欄目經理: 新增特定數量的列  |  移動列  |  切換隱藏列的可見性狀態  |  比較範圍和列 ...
特色功能: 網格焦點   |  設計圖   |   大方程式酒吧    工作簿和工作表管理器   |  資源庫 (自動文字)   |  日期選擇器   |  合併工作表   |  加密/解密單元格    按清單發送電子郵件   |  超級濾鏡   |   特殊過濾器 (過濾粗體/斜體/刪除線...)...
前 15 個工具集12 文本 工具 (添加文本, 刪除字符,...)   |   50+ 圖表 類型 (甘特圖,...)   |   40+ 實用 公式 (根據生日計算年齡,...)   |   19 插入 工具 (插入二維碼, 從路徑插入圖片,...)   |   12 轉化 工具 (數字到單詞, 貨幣兌換,...)   |   7 合併與拆分 工具 (高級合併行, 分裂細胞,...)   |   ... 和更多

使用 Kutools for Excel 增強您的 Excel 技能,體驗前所未有的效率。 Kutools for Excel 提供了 300 多種進階功能來提高生產力並節省時間。  點擊此處獲取您最需要的功能...

產品描述


Office選項卡為Office帶來了選項卡式界面,使您的工作更加輕鬆

  • 在Word,Excel,PowerPoint中啟用選項卡式編輯和閱讀,發布者,Access,Visio和Project。
  • 在同一窗口的新選項卡中而不是在新窗口中打開並創建多個文檔。
  • 將您的工作效率提高 50%,每天為您減少數百次鼠標點擊!
Comments (37)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
thanks for writing this macro it was very helpful <3
This comment was minimized by the moderator on the site
As of 10/19/21, Office365/Excel version 2109 (Build 14430.20306), the 'Merge & Split > Split Cells' option doesn't show
This comment was minimized by the moderator on the site
Hi, ggibby, have you installed Kutools for Excel in Excel? I have used Excel 2019, click Kutools tab and go to the Range & Cells group, click Merge & Split to expand the drop-down menu, you can find the Split Cells...
This comment was minimized by the moderator on the site
How do i separate in 3 columns, the time, the song name and the movie name

Annadata 02:31:50 Ja Re Ja Re Ud Ja Re Panchhi | Maya 02:36:02 Jangal Mein More Nacha | Madhumati 02:39:08 Aaha Rim Jhim Ke Ye Pyare Pyare | Usne Kaha Tha 02:44:41 Ni Sa Ga Ma Pa Ni Sa Re Sa | Anand Mahal 02:49:35 Roz Akeli Aaye | Mere Apne 02:52:51 Bagh Mein Kali Khili | Chand Aur Suraj 02:56:01 Ankhon Men Masti Sharab Ki | Chhaya 02:59:20 Chhota Sa Ghar Hoga | Naukri 03:02:32 Mere Khwabon Men Mere Khayalon Men | Honey Moon 03:05:51 Kancha Le Kanchi Lai Lajo | Madhumati 03:09:13 Tan Jale Man Jalta Rahe | Madhumati 03:12:31 Ganga Aaye Kahan Se | Kabuliwala
This comment was minimized by the moderator on the site
Hi All,
What If I had a cell that = 0815-0862
Is there a way for me to break that down in separate cells?
0815
0816
0817
0818
.
.
.


Thanks all in advance
This comment was minimized by the moderator on the site
Very helpfull. Thanks a lot.
This comment was minimized by the moderator on the site
i have data this format :--
OPTSTKMARUTI25JUN2020CE5800

I want to below mention format ( divide in five column )

OPTSTK Maruti 25 Jun 2020 CE 5800
This comment was minimized by the moderator on the site
If all your strings in same length, and each part of the string is in the same number of characters, you can use the Text to Columns > Fixed width option. See screenshot
This comment was minimized by the moderator on the site
I am getting error with the VBA.Split funtion when I am entering the <Span style>. I require it as my separator is a newline and I need to mention that. Any help would be great
This comment was minimized by the moderator on the site
Hi, Aj, the VBA code does not suuport to split cell by the new line.
This comment was minimized by the moderator on the site
i have data like this...

one cell this data
p. umesh,125 ramesh,52 sunil,478 mahesh,47 raj,75,487

result (first column name ,, second column number)
p. umesh 125
ramesh 52
sunil 478
mahesh 47
raj 75
raj 487
This comment was minimized by the moderator on the site
Hi, Sunil Graphics, if there is no trailing space after the comma and dot, you can do as these:
1. Select the cell that contains data, click Data > Text to Column, in the popping text to column dialog, check delimited > next > check space > click Finish, now the data has been split into columns based on space, like p.umesh,125 | ranesh,52 | sunil,478 |...
2. Then select these column data, press Ctrl + C to copy them, and select a another cell, right click to select Transpose in the paste options in the context menu. Now the data shows as
p.umesh,125
ranesh,52
sunil,478
3. Select the transpose data, use the Text to Column function again, this time, check delimited > next > comma > finish. Then it done.
This comment was minimized by the moderator on the site
i have data like this...
This comment was minimized by the moderator on the site
i have data like this...
p. umesh,125 ramesh,52 sunil,478 mahesh,47 raj,75,487

result
p. umesh 125
ramesh 52
sunil 478
mahesh 47
raj 75
raj 487

how to solve this
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations