0
我有代碼,移動列左,根據按鍵的權利,但列寬不保留,因爲我移動列。我想我要搬到保留其寬度列,其通過移動列還保留它們的寬度。Excel VBA中移動列,並保留寬度
Public Sub moveColumnleft()
ActiveCell.EntireColumn.Select
Selection.EntireColumn.Cut
If ActiveCell.Column = 1 Then Exit Sub
ActiveCell.offset(0, -1).Insert Shift:=xlLeft
ActiveCell.offset(0, -1).Select
End Sub
Public Sub moveColumnRight()
ActiveCell.EntireColumn.Select
Selection.EntireColumn.Cut
ActiveCell.offset(0, 2).Insert Shift:=xlRight
ActiveCell.offset(0, 1).Select
End Sub