View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
halim halim is offline
external usenet poster
 
Posts: 13
Default Remove all rows which do Not contain a particular word

Hi All,

May be you need :

Sub DellRows()

For r = 1 To 100 ' 100 is end of rows you want
If Cells(r, 1).Value = "High" Then del = del & ",A" & r
Next r
If del < "" Then Range(Mid(del, 2, Len(del))).EntireRow.Delete

End Sub


Kanga 85 menuliskan:
Thanks Dav for your interest.

The word "high" will be in column A. It will be a discrete word, but may
have other words in the same cell

Regards


"Dav" wrote:


You need to be more specific, would high be an entry in any cell in a
row or just say column A. or the first 5 columns. The longer the ranges
the longer the macro will take to run.
Also would it be in a text string or the entire cell
eg how high can you jump
or just "high"

and if it was the later was for example "highly regarded" would it be
retained as well?

Regards

Dav


--
Dav
------------------------------------------------------------------------
Dav's Profile: http://www.excelforum.com/member.php...o&userid=27107
View this thread: http://www.excelforum.com/showthread...hreadid=560979