Excel2007怎么移动整列
发布时间:2017-05-16 16:52
相关话题
在excel表格中,需要将整列数据进行移动时,应该怎么做?下面随小编一起来看看吧。
Excel2007移动整列的步骤
单击菜单栏--视图--宏--查看宏。

弹出宏的界面,输入宏的名称,这里为了便于记忆,我们命名为向左移动一列,然后点击创建按钮。

③在新出现的界面中,输入代码,也就是程序语言,我已经写好了,大家直接复制即可。
Application.ScreenUpdating = False
x = Selection.Column
If x >= 1 Then
Columns(x).Cut
Columns(x - 1).Insert
Application.ScreenUpdating = True
End If

退出编辑状态,选中单元格或者整列,执行宏即可。下面,我把向右移动一列的代码也给大家。
Application.ScreenUpdating = False
x = Selection.Column
If x < 256 Then
Columns(x).Cut
Columns(x + 2).Insert
End If
Application.ScreenUpdating = True
End Sub

Excel2007怎么移动整列的评论条评论