| 发表于:2007-05-22 19:31:172楼 得分:10 |
我也是菜鸟,供你参考。(office 2003) sub 插入空行() application.screenupdating = false '刷屏停止 为提高速度 max_h = sheets(1).usedrange.rows.count '最大行号 for i = 1 to max_h '第一行到最大行号 前值 = cells(i, 1).value '第一列,i行==a1(初值) 后值 = cells(i+1, 1).value '第一列,i+1行==a2(初值) if 后值 = 前值 and 其它条件 then rows(i + 1).select '选中整行 selection.insert shift:=xldown max_h = max_h + 1 '最大行号增加 end if next i application.screenupdating = true '刷屏恢复 end sub | | |
|