rollingzep
Board Regular
- Joined
- Nov 18, 2013
- Messages
- 214
- Office Version
- 365
- Platform
- Windows
Hi,
I have a sheet wherein I do a Vlookup. For the values that are not found, it generates the #N/A error.
I am trying to delete those rows which have the #N/A error, but it is not deleting
This is my code. I call the Del_Rows in my main code by using Call Del_Rows
<code>
Sub Del_Rows()
Dim wbexcel As Workbook
Dim ws As Worksheet
Dim LR As Long, i As Long
Set wbexcel = ThisWorkbook
Set ws = wbexcel.Sheets("TSS Fails")
LR = ws.Range("AU2:AU" & Rows.Count).End(xlUp).Row
For i = LR To Step - 1
If Cells("AU2" & i).Text = "#N/A" Then Rows(i).EntireRow.Delete
Next i
End Sub
</code>
What am I doing wrong?
I have a sheet wherein I do a Vlookup. For the values that are not found, it generates the #N/A error.
I am trying to delete those rows which have the #N/A error, but it is not deleting
This is my code. I call the Del_Rows in my main code by using Call Del_Rows
<code>
Sub Del_Rows()
Dim wbexcel As Workbook
Dim ws As Worksheet
Dim LR As Long, i As Long
Set wbexcel = ThisWorkbook
Set ws = wbexcel.Sheets("TSS Fails")
LR = ws.Range("AU2:AU" & Rows.Count).End(xlUp).Row
For i = LR To Step - 1
If Cells("AU2" & i).Text = "#N/A" Then Rows(i).EntireRow.Delete
Next i
End Sub
</code>
What am I doing wrong?