跳到主要内容

如何在Excel中垂直翻转/反转一列数据顺序?

有时,您可能想在Excel中垂直翻转一列数据顺序,如左图所示。 手动反转数据顺序似乎非常困难,尤其是对于列中的许多数据而言。 本文将指导您快速垂直翻转或反转列数据顺序。

使用Sort命令在Excel中翻转数据顺序的列
使用VBA在Excel中翻转一列数据顺序
使用 Kutools for Excel 单击几次即可翻转一列数据顺序


使用Sort命令在Excel中翻转数据顺序的列

使用“排序”命令可以通过以下步骤帮助您翻转Excel中的数据列:

1. 在该列旁边插入一系列序列号。 在这种情况下,在B列中插入1,2,3…,7,然后选择B2:B12,请参见屏幕截图:

2.  点击 时间 > 将Z排序到A,请参见屏幕截图:

3. 排序警告 对话框,检查 扩大选择 选项,然后单击 排序 按钮。

4。 然后,您将看到A列的数字顺序被翻转。 您可以根据需要删除或隐藏B列。 请参见以下屏幕截图:

此方法还适用于反转多列数据顺序。

只需单击几下,即可轻松垂直翻转日期列:

翻转垂直范围 实用程序 Kutools for Excel 只需单击几下,就可以帮助您快速快速地垂直翻转一列日期。 您只需要选择范围并启用该功能即可实现。 立即下载 Excel 版 Kutools! (30 天免费试用)


使用VBA在Excel中翻转一列数据顺序

如果您知道如何在Excel中使用VBA代码,则可以按以下方式垂直翻转/反转数据顺序:

1.  按住 其他 + F11 键,然后打开 Microsoft Visual Basic应用程序 窗口。

2.  点击 插页 > 模块,然后将以下宏粘贴到“模块窗口”中。

VBA:在Excel中垂直翻转/反转范围数据顺序。

Sub FlipColumns()
'Updateby20131126
Dim Rng As Range
Dim WorkRng As Range
Dim Arr As Variant
Dim i As Integer, j As Integer, k As Integer
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
Arr = WorkRng.Formula
For j = 1 To UBound(Arr, 2)
    k = UBound(Arr, 1)
    For i = 1 To UBound(Arr, 1) / 2
        xTemp = Arr(i, j)
        Arr(i, j) = Arr(k, j)
        Arr(k, j) = xTemp
        k = k - 1
    Next
Next
WorkRng.Formula = Arr
End Sub

3. F5 运行该宏的键,会弹出一个对话框供您选择垂直翻转的范围,请参见屏幕截图:

4.  点击 OK 在对话框中,范围是垂直翻转的,请参见屏幕截图:


使用 Kutools for Excel 单击几次即可翻转一列数据顺序

如果你有 Kutools for Excel 安装后,您可以按以下顺序反转列的数字顺序 翻转垂直范围 工具。

申请前 Kutools for Excel首先下载并安装.

1. 选择要垂直翻转的日期列,然后单击 库工具 > 范围 > 翻转垂直范围 > 所有类型 / 仅翻转值。 看截图:

请注意: 如果要翻转元数据以及单元格格式,请选择 所有类型 选项。 对于仅翻转值,请选择 仅翻转值 选项。

然后,该列中的所选数据已垂直翻转。 看截图:

Tips::如果还需要在Excel中水平翻转数据。 请尝试 翻转水平范围 实用程序 Kutools for Excel。 您只需要首先选择两个范围,然后应用该实用程序即可实现它,如下图所示。

然后,所选范围立即水平翻转。

  如果您想免费试用(30天)此实用程序, 请点击下载,然后按照上述步骤进行操作。


演示:垂直翻转/反转一列数据顺序


相关文章:

如何在Excel中快速翻转/反转一行数据顺序?

最佳办公生产力工具

🤖 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 (23)
Rated 4.5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
Dès que j'ai lu "Insérez une série de numéros de séquence à côté de la colonne...", j'ai compris l'astuce: Merci beaucoup, ça fonctionne TB!
This comment was minimized by the moderator on the site
This was super helpful!!!
Rated 4.5 out of 5
This comment was minimized by the moderator on the site
This is so redundant. Just:

1. "select all" the data,

2. "copy"

3. go to a "new sheet/workbook"

4. "right click" and "paste special - TRANSPOSE"
This comment was minimized by the moderator on the site
Thank you very much!
This comment was minimized by the moderator on the site
THANK YOU POLLO
This comment was minimized by the moderator on the site
THANK YOU VERY VERY MUCH!
This comment was minimized by the moderator on the site
Thank you very much! It really helped me!
This comment was minimized by the moderator on the site
how i can change macro to flip horisontally?
This comment was minimized by the moderator on the site
Basically I need the same as above but the amount of fields vertically can change from 1 to 12. Then, for example 3 fields, I would need number 3 to be at the top... If 11 then 11 at the top. It's random everytime between 1&12 though. Any ideas? As trying INDEX but to no avail :(
This comment was minimized by the moderator on the site
Why .. why in the hell do people and not just you ... have to prove how to reinvent the wheel and show how to do things that don't need to be done . How to flip / reverse a column of data order vertically in Excel? All you have to do is tell people to hi - light the data and go push the a/z button and it's done . Yeah I don't know what I am doing .. excel is shit because it's hard to use ... but this was so easy and you make so hard . You're not and educator . Duncan Adams
This comment was minimized by the moderator on the site
That's actually not true. The A/Z button SORTS it (usually from low to high or form a to z), but it doesnt FLIP it. Yes, it does flip when it's ordered from a to z or from low to high, but what if it's not? So yes, this is useful. Please think before you speak Duncan.
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