Cheers,Use a filter
it is one of many steps in a workbook for a daily morning job that we run. We are looking to take the human element out of the process to minimise the risk of missed steps and output errors (it is a large worksheet with many similarly named columns) and so that any team member can run the job.Why are you using code ?
Thanks for the code. I still have the same problem ie. (using your example my criteria value would be 'Sub' within the full string 'Subtotal')Below code loops through col A, and deletes the entire row, if the word "Subtotal" is found.
See if you can adapt
Dim i As Long
Dim LASTROW As Long
LASTROW = Cells(Rows.Count, 1).End(xlUp).Row
' ** Deletes rows where col A value = "Subtotal"
For i = LASTROW To 1 Step -1
If InStr(Range("A" & i).Value, "Subtotal") Then Range("A" & i).EntireRow.Delete Shift:=xlUp
Next i
That has worked- thanks for bearing with me!Change this line
If InStr(Range("A" & i).Value, "Subtotal") Then Range("A" & i).EntireRow.Delete Shift:=xlUp
to
If InStr(Range("A" & i).Value, "Sub") Then Range("A" & i).EntireRow.Delete Shift:=xlUp