I have the following sample data below
I have written code to delete the rows where the data contains a ~, but the code does not delete any rows where the txt contains a ~
It would be appreciated if someone could amend my code
I have written code to delete the rows where the data contains a ~, but the code does not delete any rows where the txt contains a ~
Book1 | |||
---|---|---|---|
A | |||
1 | M_BR1.xlsm | ||
2 | ~$M_BR1.xlsm | ||
3 | M_BR2.xlsm | ||
4 | ~$M_BR2.xlsm | ||
Workspace |
Code:
Sub Del_Unwanted()
Sheets(1).Select
Dim LR As Long, i As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
For i = LR To 1 Step -1
If Range("A" & i).Value = "~" Then Range("A" & i).EntireRow.Delete
Next i
End Sub
It would be appreciated if someone could amend my code
Last edited: