Hi All,
I am using below code to delete rows if cells from L4 to L& Last Row has first 5 characters as "Total".
I am getting error, "Wrong number of arguments or invalid property assignment". Code is placed in Module.
Code is as below:
Sub RowDelete()
Dim PT4 As Worksheet
Set PT4 = Worksheets("Sheet1")
Dim finalRow2 As Long
finalRow2 = PT4.Cells(Application.Rows.Count, 1).End(xlUp).Row
Dim i As Integer
i = 4
Do Until i = finalRow2
If left(CStr(Cells(i, 12).Value), 5) = "Total" Then
Rows(i).Delete xlShiftUp
Else
i = i + 1
End If
Loop
End Sub
Bookmarks