Thanks for your help guys
Ryan, that is actually the exact opposite of what I want to do, I actually
want to keep the rows that have the word total in them and delete the rest.
when I subtotalled my data, then copied and pasted specialled it, the rows I
want to keep have cells that are e.g. "1 Total".
Ron I went to your website and followed some of the examples, I was able to
delete all the names except "ron" which is similar to what I want to do
except that I want to delete rows with cells like "1 total", but leave the
rows with "1"
Any help either of you can give me would be great.
> I think this will do what you want:
> Sub Delete_with_Autofilter()
[quoted text clipped - 34 lines]
> > > "*Total*" in them. I am fairly new to vba and would appreciate any help
> > > anyone can give me.
Ron de Bruin - 25 Mar 2008 21:10 GMT
>> want to keep the rows that have the word total in them and delete the rest.
Try
DeleteValue = "<>*total*"
Like this
Sub Delete_with_Autofilter()
Dim DeleteValue As String
Dim rng As Range
Dim calcmode As Long
With Application
calcmode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With
'Fill in the value that you want to delete
'Tip: use DeleteValue = "<>ron" to delete rows without ron
DeleteValue = "<>*total*"
'Sheet with the data, you can also use Sheets("MySheet")
With ActiveSheet
'Firstly, remove the AutoFilter
.AutoFilterMode = False
'Apply the filter
.Range("A1:A" & .Rows.Count).AutoFilter Field:=1, Criteria1:=DeleteValue
With .AutoFilter.Range
On Error Resume Next
Set rng = .Offset(1, 0).Resize(.Rows.Count - 1, 1) _
.SpecialCells(xlCellTypeVisible)
On Error GoTo 0
If Not rng Is Nothing Then rng.EntireRow.Delete
End With
'Remove the AutoFilter
.AutoFilterMode = False
End With
With Application
.ScreenUpdating = True
.Calculation = calcmode
End With
End Sub

Signature
Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm
> Thanks for your help guys
> Ryan, that is actually the exact opposite of what I want to do, I actually
[quoted text clipped - 47 lines]
>> > > "*Total*" in them. I am fairly new to vba and would appreciate any help
>> > > anyone can give me.