View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Delete from the bottom up

I would probably use code something like this...

Sub DeleteStuff()
Dim rngFound As Range

With Sheets("Sheet1")
Set rngFound = .Range("A:A").Find(What:="Item 1", _
After:=.Range("A1"), _
Lookat:=xlWhole, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Offset(1, 0)
If Not rngFound Is Nothing Then
.Range(rngFound, .Cells(Rows.Count, "A")).Delete Shift:=xlUp
End If
End With
End Sub
--
HTH...

Jim Thomlinson


" wrote:

I am wondering if it's possible to delete from the bottom up but by
recognizing strings not numbers. I have a list like this.
Item1
Item1
Item1
Item1
Item3
Item4
Item4

Now is there a way for a loop to run and either work from the bottom
going up deleting everything that is not an item1 or is there a way
from the top to look down and see where it's no longer item one and
delete everything under it. However, I don't need to delete the whole
row just the column. Thanks