与Selection.Insert Shift相比偏移量= xlToRight
我有以下macros,并希望减less行数,以加快进程。
5 ActiveCell.Columns("A:A").EntireColumn.Select If Selection.Find(What:="*", After:=ActiveCell, LookIn:=xlValues, _ LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _ MatchCase:=True) Is Nothing Then GoTo 6 End If Selection.Find(What:="*", After:=ActiveCell, LookIn:=xlValues, _ LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _ MatchCase:=True).Activate ActiveCell.Select Selection.Insert Shift:=xlToRight Selection.Insert Shift:=xlToRight Selection.Insert Shift:=xlToRight Selection.Insert Shift:=xlToRight Selection.Insert Shift:=xlToRight GoTo 5
我想用偏移量replace多个“Selection.Insert Shift:= xlToRight”行。
你能帮忙吗?
replace你的x5 Selection.Insert Shift:=xlToRight
by Range(ActiveCell, ActiveCell.Offset(0, 4)).Insert shift:=xlToRight
编辑
更多相关的代码: Range(Selection, Selection.Offset(0, 4)).Insert shift:=xlToRight