Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Kanga 85
 
Posts: n/a
Default Remove complete row containing a single word

I need to find the word "High" in a whole speedsheet, and remove the whole
row containg that word.
Thanks
  #2   Report Post  
R.VENKATARAMAN
 
Posts: n/a
Default

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
====================



==========================
Kanga 85 wrote in message
...
I need to find the word "High" in a whole speedsheet, and remove the whole
row containg that word.
Thanks



  #3   Report Post  
Ronbo
 
Posts: n/a
Default

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




"R.VENKATARAMAN" wrote:

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
====================



==========================
Kanga 85 wrote in message
...
I need to find the word "High" in a whole speedsheet, and remove the whole
row containg that word.
Thanks




  #4   Report Post  
R.VENKATARAMAN
 
Posts: n/a
Default

elegant . I was searching for that <shift=xlup I used to use some
tortuous statments. thanks a lot



Ronbo wrote in message
...
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




"R.VENKATARAMAN" wrote:

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
====================



==========================
Kanga 85 wrote in message
...
I need to find the word "High" in a whole speedsheet, and remove the

whole
row containg that word.
Thanks






  #5   Report Post  
Kanga 85
 
Posts: n/a
Default

Thanks to you both.

"R.VENKATARAMAN" wrote:

elegant . I was searching for that <shift=xlup I used to use some
tortuous statments. thanks a lot



Ronbo wrote in message
...
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




"R.VENKATARAMAN" wrote:

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
====================



==========================
Kanga 85 wrote in message
...
I need to find the word "High" in a whole speedsheet, and remove the

whole
row containg that word.
Thanks








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove the word 'total' from subtotals yahoo Excel Discussion (Misc queries) 2 February 13th 05 01:26 AM
exporting single cells to Word Anja B Excel Discussion (Misc queries) 3 February 2nd 05 08:47 PM
Remove single text characters mawme Excel Discussion (Misc queries) 1 January 27th 05 10:25 PM
How to remove a word from dictionary? robmirabile Excel Discussion (Misc queries) 7 December 8th 04 06:39 PM
Paste rows of numbers from Word into single Excel cell BecG Excel Discussion (Misc queries) 1 December 8th 04 04:55 PM


All times are GMT +1. The time now is 11:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"