I've got a file that has lots of data over several categories, and a sub total after each category. I want to delete the rows that have this sub total in it, just want the file to be flat.
I've got it to work for a particular file that has 2 categories, but I want to use a Do While (or For loop), cos some of the other files have >2 categories, so hard coding the rows to delete doesn't exactly work
The word that is common (and in my current find) is "Total". This is what I have so far, any ideas on what I should wrap this in?
Thanks in advance
Dim r As Integer
Cells.Find(What:="Total", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate
r = ActiveCell.Row
Rows(r).Select
Selection.Delete Shift:=xlUp
Mellen
I've got it to work for a particular file that has 2 categories, but I want to use a Do While (or For loop), cos some of the other files have >2 categories, so hard coding the rows to delete doesn't exactly work
The word that is common (and in my current find) is "Total". This is what I have so far, any ideas on what I should wrap this in?
Thanks in advance
Dim r As Integer
Cells.Find(What:="Total", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate
r = ActiveCell.Row
Rows(r).Select
Selection.Delete Shift:=xlUp
Mellen