請測試看看,謝謝
Sub test()
Dim xR As Range, R%, Clr
Application.ScreenUpdating = False
R = 1
With Sheets(1)
If .AutoFilterMode Then .[a1].AutoFilter
For Each xR In .Range(.[a1], .Cells(.Rows.Count, 1).End(3))
Clr = xR.DisplayFormat.Interior.ColorIndex
If Clr <> -4142 Then
xR.Resize(, 1).Copy Sheets(2).Cells(R, 1)
R = R + 1
End If
Next
End With
Application.ScreenUpdating = True
End Sub作者: jsc0518 時間: 2022-3-23 20:38
請再測試看看,謝謝
Sub test2()
Dim xR As Range, xU As Range, Clr
Application.ScreenUpdating = False
With Sheets(1)
If .AutoFilterMode Then .[a1].AutoFilter
For Each xR In .Range(.[a1], .Cells(.Rows.Count, 1).End(3))
Clr = xR.DisplayFormat.Interior.ColorIndex
If Not Clr <> -4142 Then
If xU Is Nothing Then Set xU = xR Else Set xU = Union(xR, xU)
End If
Next
End With
If Not xU Is Nothing Then xU.EntireRow.Delete
Application.ScreenUpdating = True
End Sub作者: jsc0518 時間: 2022-3-24 22:08