sub a()for i=[a65536].end(3).row to 2 step -1 if range("A"&i)>ran" />
乔山办公网我们一直在努力
您的位置:乔山办公网 > excel表格制作 > <em>excel</em>如何用宏实现:满足条件(An+1&gt;An)插入3行-ex

<em>excel</em>如何用宏实现:满足条件(An+1&gt;An)插入3行-ex

作者:乔山办公网日期:

返回目录:excel表格制作




sub a()
for i=[a65536].end(3).row to 2 step -1
     if range("A"&i)>range("A"&i-1) then 
        for j=1 to 3
             rows(i).insert
        next j
    end if
next i
end sub



经测,下面的代码可
Dim i As Long

i = 3
Do
If Cells(i, 5).Value <> Cells(i - 1, 5).Value And Cells(i, 5).Value <> 0 Then
Rows(i).Insert shift:=xlDown
i = i + 1
End If
If Cells(i, 5) = 0 And i > Sheet1.UsedRange.Rows.Count Then Exit Do
i = i + 1
Loop

相关阅读

关键词不能为空
极力推荐

ppt怎么做_excel表格制作_office365_word文档_365办公网