Excel 無內建「移動欄位」快捷鍵,透過錄製巨集並編輯 VBA 即可實現一鍵左移/右移:
MoveLeft → 「建立」。Sub MoveLeft()
Application.ScreenUpdating = False
x = Selection.Column
If x >= 2 Then
Columns(x).Cut
Columns(x - 1).Insert Shift:=xlToRight
End If
Application.ScreenUpdating = True
End Sub
MoveLeft 執行),該欄即左移一欄。同樣建立巨集 MoveRight,代碼:
Sub MoveRight()
Application.ScreenUpdating = False
x = Selection.Column
If x <= 255 Then ' Excel 2007 欄上限 256 (XFD=16384 於 2007+)
Columns(x).Cut
Columns(x + 1).Insert Shift:=xlToRight
End If
Application.ScreenUpdating = True
End Sub

開啟巨集對話框

命名巨集

編輯 VBA 代碼

向右移動代碼
將巨集加入「快速存取工具列」或指定快捷鍵(選項→自訂功能區→巨集),即可一鍵左右移動欄位,大幅提升整理表格效率。