For i = 1 To 1000
If Rows(i).Interior.ColorIndex = 3 Or Rows(i).Interior.ColorIndex = 10 Then
Rows(i).Delete Shift:=xlUp
i = i - 1……
[/Quote]
程序应这样写:
Sub Macro1()
For i = 1000 To 1 Step -1
If Rows(i).Interior.ColorIndex = 3 Or Rows(i).Interior.ColorIndex = 10 Then
Rows(i).Delete Shift:=xlUp
i = i - 1
End If
Next
End Sub
For i = 1 To 1000
If Rows(i).Interior.ColorIndex = 3 Or Rows(i).Interior.ColorIndex = 10 Then
Rows(i).Delete Shift:=xlUp
i = i - 1……
[/Quote]
程序应这样写:
Sub Macro1()
For i = 1000 To 1 Step -1
If Rows(i).Interior.ColorIndex = 3 Or Rows(i).Interior.ColorIndex = 10 Then
Rows(i).Delete Shift:=xlUp
i = i - 1
End If
Next
End Sub