the issue is that the code is is deleting more than i ask for. it also deletes a cell that is not colored.
Code:
Sub delete_test_2()
Dim MyFolder As String
Dim cell As Range
Application.ScreenUpdating = False
With Sheets("Delete Revs")
MyFolder = .Range("K1").Value & "\"
For Each cell In .Range("C3:C17")
If cell.Interior.Color = RGB(255, 255, 255) And cell.Offset(0, 1) = "A" Then
Kill MyFolder & cell.Value & ".pdf"
cell.Offset(0, 1).Delete xlShiftUp
cell.Offset(0, 2).Delete xlShiftUp
cell.Delete xlShiftUp
End If
Next cell
For Each cell In .Range("C3:C17")
If cell.Interior.Color = RGB(255, 255, 255) And cell.Offset(0, 1) = "0" Then
Kill MyFolder & cell.Value & ".pdf"
cell.Offset(0, 1).Delete xlShiftUp
cell.Offset(0, 2).Delete xlShiftUp
cell.Delete xlShiftUp
End If
Next cell
Last edited by a moderator: