ls 发表于 2011-12-26 02:15
x = Cells(1, Columns.Count).End(xlToLeft).Column
?
取最后一列的列数
这样也可以
Dim x As Integer
Sub 列()
If x > 0 Then Exit Sub
x = Cells(1, 1).End(xlToRight).Column
For i = x To 3 Step -1
Columns(i).Insert Shift:=xlToRight
Cells(1, i) = "aaa"
Next i
End Sub