跳到主要內容

如何在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列。 請參見以下屏幕截圖:

此方法還適用於反轉多列數據順序。

只需單擊幾下,即可輕鬆地垂直翻轉一列日期:

翻轉垂直範圍 的效用 Excel的Kutools 只需單擊幾下,就可以幫助您快速快速地垂直翻轉一列日期。 您只需要選擇範圍並啟用該功能即可實現。 立即下載 Kutools for Excel! (30 天免費試用)


使用VBA在Excel中翻轉一列數據順序

如果您知道如何在Excel中使用VBA代碼,則可以按以下方式垂直翻轉/反轉數據順序:

1.  按住 其他 + F11 鍵,然後打開 Microsoft Visual Basic for Applications 窗口。

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翻轉一列數據順序

如果你有 Excel的Kutools 安裝後,您可以使用 翻轉垂直範圍 工具迅速。

申請前 Excel的Kutools首先下載並安裝.

1. 選擇您將垂直翻轉的日期列,然後單擊 庫工具 > 範圍 > 翻轉垂直範圍 > 全部 / 僅翻轉值。 看截圖:

注意: 如果要翻轉元數據以及單元格格式,請選擇 全部 選項。 對於僅翻轉值,請選擇 僅翻轉值 選項。

然後,該列中的所選數據已垂直翻轉。 看截圖:

尖端:如果還需要在Excel中水平翻轉數據。 請嘗試 翻轉水平範圍 的效用 Excel的Kutools。 您只需要首先選擇兩個範圍,然後應用該實用程序即可實現它,如下圖所示。

然後,所選範圍立即水平翻轉。

  如果您想免費試用(30天)此實用程序, 請點擊下載,然後按照上述步驟進行操作。


演示:垂直翻轉/反轉一列數據順序


相關文章:

如何在Excel中快速翻轉/反轉一行數據順序?

最佳辦公生產力工具

🤖 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 (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