reubanrao93
New Member
- Joined
- Dec 7, 2020
- Messages
- 20
- Office Version
- 365
- Platform
- Windows
Evening gurus,
This VBA is to delete rows for any cells of Columns I containing "Failed" followed by cells on Column N containing "VALUE!". It works flawlessly for Column I criteria whoever 'Run-time error'13: Type Mismatch Error' occurs on Column N. All the columns has been pasted as value hence the cell VALUE! does not have any reference. Is there anything I'm missing here?
Application.ScreenUpdating = True
Sheets("OUTPUT").Range("I:I").Select
Last = Cells(Rows.Count, "I").End(xlUp).Row
For I = Last To 1 Step -1
If (Cells(I, "I").Value) = "Failed" Then
Cells(I, "A").EntireRow.Delete
End If
Next I
Sheets("OUTPUT").Range("N:N").Select
Last = Cells(Rows.Count, "N").End(xlUp).Row
For N = Last To 1 Step -1
If (Cells(N, "N").Value) = "VALUE!" Then <--- Run-time error'13: Type Mismatch occurs here
Cells(N, "A").EntireRow.Delete
End If
Next N
End Sub
This VBA is to delete rows for any cells of Columns I containing "Failed" followed by cells on Column N containing "VALUE!". It works flawlessly for Column I criteria whoever 'Run-time error'13: Type Mismatch Error' occurs on Column N. All the columns has been pasted as value hence the cell VALUE! does not have any reference. Is there anything I'm missing here?
Application.ScreenUpdating = True
Sheets("OUTPUT").Range("I:I").Select
Last = Cells(Rows.Count, "I").End(xlUp).Row
For I = Last To 1 Step -1
If (Cells(I, "I").Value) = "Failed" Then
Cells(I, "A").EntireRow.Delete
End If
Next I
Sheets("OUTPUT").Range("N:N").Select
Last = Cells(Rows.Count, "N").End(xlUp).Row
For N = Last To 1 Step -1
If (Cells(N, "N").Value) = "VALUE!" Then <--- Run-time error'13: Type Mismatch occurs here
Cells(N, "A").EntireRow.Delete
End If
Next N
End Sub