|
新增如下3列紅字,謝謝
Sub 删除非检测项目取消高亮()
Dim sh As Integer
Application.ScreenUpdating = False
For sh = 2 To Sheets.Count
Sheets(sh).Select
If Cells(705, 1).Interior.ColorIndex <> 6 Then
Range("A693:J710").Select
Selection.Delete Shift:=xlUp
End If
If Cells(687, 1).Interior.ColorIndex <> 6 Then
Range("A675:J692").Select
Selection.Delete Shift:=xlUp
End If
If Cells(669, 1).Interior.ColorIndex <> 6 Then
Range("A657:J674").Select
Selection.Delete Shift:=xlUp
End If
If Cells(651, 1).Interior.ColorIndex <> 6 Then
Range("A639:J656").Select
Selection.Delete Shift:=xlUp
End If
If Cells(633, 1).Interior.ColorIndex <> 6 Then
Range("A621:J638").Select
Selection.Delete Shift:=xlUp
End If
If Cells(615, 1).Interior.ColorIndex <> 6 Then
Range("A603:J620").Select
Selection.Delete Shift:=xlUp
End If
If Cells(597, 1).Interior.ColorIndex <> 6 Then
Range("A585:J602").Select
Selection.Delete Shift:=xlUp
End If
If Cells(579, 1).Interior.ColorIndex <> 6 Then
Range("A567:J584").Select
Selection.Delete Shift:=xlUp
End If
If Cells(561, 1).Interior.ColorIndex <> 6 Then
Range("A549:J566").Select
Selection.Delete Shift:=xlUp
End If
If Cells(543, 1).Interior.ColorIndex <> 6 Then
Range("A531:J548").Select
Selection.Delete Shift:=xlUp
End If
If Cells(525, 1).Interior.ColorIndex <> 6 Then
Range("A513:J530").Select
Selection.Delete Shift:=xlUp
End If
If Cells(507, 1).Interior.ColorIndex <> 6 Then
Range("A495:J512").Select
Selection.Delete Shift:=xlUp
End If
If Cells(489, 1).Interior.ColorIndex <> 6 Then
Range("A477:J494").Select
Selection.Delete Shift:=xlUp
End If
If Cells(471, 1).Interior.ColorIndex <> 6 Then
Range("A459:J476").Select
Selection.Delete Shift:=xlUp
End If
If Cells(453, 1).Interior.ColorIndex <> 6 Then
Range("A441:J458").Select
Selection.Delete Shift:=xlUp
End If
If Cells(435, 1).Interior.ColorIndex <> 6 Then
Range("A423:J440").Select
Selection.Delete Shift:=xlUp
End If
If Cells(417, 1).Interior.ColorIndex <> 6 Then
Range("A405:J422").Select
Selection.Delete Shift:=xlUp
End If
If Cells(399, 1).Interior.ColorIndex <> 6 Then
Range("A387:J404").Select
Selection.Delete Shift:=xlUp
End If
If Cells(381, 1).Interior.ColorIndex <> 6 Then
Range("A369:J386").Select
Selection.Delete Shift:=xlUp
End If
If Cells(363, 1).Interior.ColorIndex <> 6 Then
Range("A351:J368").Select
Selection.Delete Shift:=xlUp
End If
If Cells(345, 1).Interior.ColorIndex <> 6 Then
Range("A333:J350").Select
Selection.Delete Shift:=xlUp
End If
If Cells(327, 1).Interior.ColorIndex <> 6 Then
Range("A315:J332").Select
Selection.Delete Shift:=xlUp
End If
If Cells(309, 1).Interior.ColorIndex <> 6 Then
Range("A297:J314").Select
Selection.Delete Shift:=xlUp
End If
If Cells(291, 1).Interior.ColorIndex <> 6 Then
Range("A279:J296").Select
Selection.Delete Shift:=xlUp
End If
If Cells(273, 1).Interior.ColorIndex <> 6 Then
Range("A261:J278").Select
Selection.Delete Shift:=xlUp
End If
If Cells(255, 1).Interior.ColorIndex <> 6 Then
Range("A243:J260").Select
Selection.Delete Shift:=xlUp
End If
If Cells(237, 1).Interior.ColorIndex <> 6 Then
Range("A225:J242").Select
Selection.Delete Shift:=xlUp
End If
If Cells(219, 1).Interior.ColorIndex <> 6 Then
Range("A207:J224").Select
Selection.Delete Shift:=xlUp
End If
If Cells(201, 1).Interior.ColorIndex <> 6 Then
Range("A189:J206").Select
Selection.Delete Shift:=xlUp
End If
If Cells(183, 1).Interior.ColorIndex <> 6 Then
Range("A171:J188").Select
Selection.Delete Shift:=xlUp
End If
If Cells(165, 1).Interior.ColorIndex <> 6 Then
Range("A153:J170").Select
Selection.Delete Shift:=xlUp
End If
If Cells(147, 1).Interior.ColorIndex <> 6 Then
Range("A135:J152").Select
Selection.Delete Shift:=xlUp
End If
If Cells(129, 1).Interior.ColorIndex <> 6 Then
Range("A117:J134").Select
Selection.Delete Shift:=xlUp
End If
If Cells(111, 1).Interior.ColorIndex <> 6 Then
Range("A99:J116").Select
Selection.Delete Shift:=xlUp
End If
If Cells(93, 1).Interior.ColorIndex <> 6 Then
Range("A81:J98").Select
Selection.Delete Shift:=xlUp
End If
If Cells(75, 1).Interior.ColorIndex <> 6 Then
Range("A63:J80").Select
Selection.Delete Shift:=xlUp
End If
If Cells(57, 1).Interior.ColorIndex <> 6 Then
Range("A45:J62").Select
Selection.Delete Shift:=xlUp
End If
If Cells(39, 1).Interior.ColorIndex <> 6 Then
Range("A27:J44").Select
Selection.Delete Shift:=xlUp
End If
If Cells(21, 1).Interior.ColorIndex <> 6 Then
Range("A9:J26").Select
Selection.Delete Shift:=xlUp
End If
' 取消高亮
Range("A1:Q200").Interior.ColorIndex = -4142
Next
End Sub
|
|