griffindor2020
New Member
- Joined
- Jun 6, 2020
- Messages
- 20
- Office Version
- 2016
- Platform
- MacOS
Hello,
I've been trying to delete rows in my data set that contain the following keyword "lename"
This is the following script I found and the following error
Script :
Sub Delete_All_Rows_IF_Cell_Contains_Certain_String_Text()
Dim lRow As Long
Dim iCntr As Long
lRow = 150000
For iCntr = lRow To 1 Step -1
If Cells(iCntr, 3).Value = "lename" Then
Rows(iCntr).Delete
End If
Next
End
Error:
Compile Error : Expected End Sub
Let me know what went wrong and what is the best way to fix it
Thank you.
I've been trying to delete rows in my data set that contain the following keyword "lename"
This is the following script I found and the following error
Script :
Sub Delete_All_Rows_IF_Cell_Contains_Certain_String_Text()
Dim lRow As Long
Dim iCntr As Long
lRow = 150000
For iCntr = lRow To 1 Step -1
If Cells(iCntr, 3).Value = "lename" Then
Rows(iCntr).Delete
End If
Next
End
Error:
Compile Error : Expected End Sub
Let me know what went wrong and what is the best way to fix it
Thank you.