HI,
I have a row of data and want to delete a row if the condition is true. What is wrong with my code?
Sub deltotal()
Lastr = Cells(rows.Count, "A").End(xlUp).row
ctes = Range(x, 1)
For x = 1 To Lastr Step 1
If Application.WorksheetFunction.Left(ctes, 18) = "Total for Customer" Then
row.Delete
Next x
Else
MsgBox ("NONON")
End Sub
I have a row of data and want to delete a row if the condition is true. What is wrong with my code?
Sub deltotal()
Lastr = Cells(rows.Count, "A").End(xlUp).row
ctes = Range(x, 1)
For x = 1 To Lastr Step 1
If Application.WorksheetFunction.Left(ctes, 18) = "Total for Customer" Then
row.Delete
Next x
Else
MsgBox ("NONON")
End Sub