Remove complete row containing a single word

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to find the word "High" in a whole speedsheet, and remove the whole
row containg that word.
Thanks
 
data is from A1 to A15 A1 has heading e.g."data"-I think heading is
necessary for filering

try this sub

Public Sub test()
Range("a1:a15").Select
Selection.AutoFilter Field:=1, Criteria1:="high"
On Error GoTo line1
With Sheet1.Range("a2:a15")
..Cells.SpecialCells(xlCellTypeVisible).EntireRow.Delete
End With
Range("B1").Activate
Selection.AutoFilter

line1:
End Sub
====================



==========================
 
You might try the following, with a little less code.

Sub FindCellDeleteRow()
'
Cells.Find(What:="high").Activate
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Delete Shift:=xlUp
End Sub
 
elegant . I was searching for that <shift=xlup> I used to use some
tortuous statments. thanks a lot
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top