I am new to VBA and I have a problem with the following code:
The code works its way down a column and is supposed to delete any row with an "#N/A" error. However, when I run my code, it stops when it comes to the "#N/A" error and I get the following error message:
Run-time error'13': Type mismatch
I think part of the problem maybe the fact that there is an earlier part of the code (not shown) that turns all "#N/A" errors to values. It appears that my code does not recognize the "#N/A" error as an error.
I would appreciate any help on this matter.
Code:
Dim Count As Integer
For Count = 1 To 100
If ActiveCell = "#N/A" Then Selection.EntireRow.Delete Else ActiveCell.Offset(1, 0).Select
Next Count
The code works its way down a column and is supposed to delete any row with an "#N/A" error. However, when I run my code, it stops when it comes to the "#N/A" error and I get the following error message:
Run-time error'13': Type mismatch
I think part of the problem maybe the fact that there is an earlier part of the code (not shown) that turns all "#N/A" errors to values. It appears that my code does not recognize the "#N/A" error as an error.
I would appreciate any help on this matter.