跳到主要内容

如何在Excel中将一个单元格转换为多个单元格/行?

有时,如果Excel单元格中有很多数据,则很难查看所有数据。 在这种情况下,将该单元格中的所有数据转换为多个单元格或行可以使查看长内容变得更加容易和清晰,如下所示。 在Excel中,您可以通过以下方法完成此操作。

在Excel中使用“文本到列”和“选择性粘贴”将一个单元格转换为多个单元格/行

使用VBA将一个单元转换为多个单元/行

使用 Kutools for Excel 将一个单元格转换为多列/行 好主意3


箭头蓝色右气泡 在Excel中使用“文本到列”和“选择性粘贴”将一个单元格转换为多个单元格/行

1.选择要转换其数据的单元格,然后单击 时间 > 文字至栏,请参见屏幕截图:

2.在弹出对话框中,选中 分隔 复选框,然后单击 下一页。 看截图:

3。 检查 逗号 仅在对话框中选中复选框,然后单击 完成。 看截图:

4.然后,您可以看到单元格数据已拆分为多列。 现在选择这些单元格,然后单击鼠标右键单击 复制 从上下文菜单复制它们。 看截图:

5.选择所需的空白单元格,然后右键单击以选择 转置(T),那么您可以看到数据已转换为多行。 看截图:

如果您使用的是Microsoft Excel 2007,请单击 主页 > > 颠倒 粘贴拆分数据。

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


根据定界符快速将一个单元格拆分为列或行

在Excel中,使用向导逐步将单元格拆分为列很麻烦。 但是随着 Kutools for Excel'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代码,以及 KutoolsForexcel. 弹出对话框,供您选择要转换其数据的单个单元格。 看截图:

4。 点击 OK,然后在另一个弹出对话框中选择一个单元格以输出结果。 看截图:

您可以看到结果:

Tips::在上面的VBA代码中,您可以更改分隔符 “,” 您希望将数据分开。 此VBA不支持基于换行符的拆分单元格。


箭头蓝色右气泡 使用 Kutools for Excel 将一个单元格转换为多列/行

如果你有 Kutools for Excel -安装了方便的工具,您可以使用它 分裂细胞 可以根据定界符快速将单个单元格拆分为多列或多行。

Kutools for Excel:便捷的Excel加载项工具,使您的工作更加轻松和高效。
  • 300+ 功能强大且易于使用的功能,110,000+ Excel用户的选择
  • 全功能 30 天免费试用,无需信用卡
  • 多种一键式功能,可缩短您解决复杂问题的时间
  • 包括批量转换,删除,合并工作表/单元格,展开等功能,现在免费尝试。

安装后 Kutools for Excel,请执行以下操作:(立即免费下载Kutools for Excel!)

1.选择要拆分为行的单元格,然后单击 库工具 > 合并与拆分 > 分裂细胞。 看截图:
doc kutools分割储存格1

2.然后在 分裂细胞 对话框,检查 拆分为行 选项下 Type 部分,并检查 其他名称 选项下 指定分隔符 部分,然后在文本框中输入您要分割单元格的定界符。 看截图:

文档库工具 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 Tab 为 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