Run-time error'13: Type Mismatch Error

reubanrao93

New Member
Joined
Dec 7, 2020
Messages
20
Office Version
  1. 365
Platform
  1. 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
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Are you sure that you have VALUE! in the cell and not #VALUE!
 
Upvote 0
Hi
I guess something like
VBA Code:
If VarType(Cells(N, "N").Value) = vbError Then
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,252
Members
452,623
Latest member
Techenthusiast

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top