excel中列值的循环移位

我怎样才能在Excel中执行列值的循环移位?

我试过了:

Sub RowInsert() Application.ScreenUpdating = False Rows("1:1").Select Selection.Insert Shift:=xlDown Range("A1").Select Selection.End(xlDown).Select Selection.End(xlDown).Select Selection.Cut Range("A1").Select ActiveSheet.Paste Application.ScreenUpdating = True End Sub 

但它不工作..有没有办法做到这一点,没有VB?

要就地循环arrays,您可以这样做。 它比插入行,剪切和粘贴更有效率,而且不会弄乱你的工作表的其余部分。

 Dim arr As Variant Dim temp As Variant Dim r As Range Dim i As Long Dim n As Long 'Specify range Set r = Range(Range("A1"), Range("A1").End(xlDown)) 'Read range into a Variant array arr = r.Value 'Count elements n = UBound(arr, 1) 'Take bottom element and set aside temp = arr(n, 1) 'Move each element down by 1, starting from bottom For i = UBound(arr, 1) To 2 Step -1 arr(i, 1) = arr(i - 1, 1) Next i 'Put old bottom element in first place arr(1, 1) = temp 'Write array back to sheet r.Value = arr