Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Removing rows featuring certain words

Hello,

I am looking to remove all rows featuring a certain word in an activ
sheet. the word is confined to a single colum. I would like to use
macro to do this but if anyone can think of a way to do it short o
deleting each cell individually my self that would help too

thanks a million

Chuc

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Removing rows featuring certain words

If the word is a constant value in the cell (not produced by a formula) and
stands alone.

Word = "word to look for"
With Columns(5)
.Replace What:=Word, Replacement:="=NA()", _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
MatchCase:=False
.SpecialCells(xlCellTypeFormulas, xlErrors).EntireRow.Delete
End With

--
Regards,
Tom Ogilvy



"clane " wrote in message
...
Hello,

I am looking to remove all rows featuring a certain word in an active
sheet. the word is confined to a single colum. I would like to use a
macro to do this but if anyone can think of a way to do it short of
deleting each cell individually my self that would help too

thanks a million

Chuck


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Removing rows featuring certain words

Hi
try the following macro:
Sub delete_rows()
Dim lastrow As Long
Dim row_index As Long
Application.ScreenUpdating = False
lastrow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
For row_index = lastrow - 1 To 1 Step -1
If Cells(row_index, "A").Value= "your_value" then
Rows(row_index).delete
End If
Next
Application.ScreenUpdating = True
End Sub

-----Original Message-----
Hello,

I am looking to remove all rows featuring a certain word

in an active
sheet. the word is confined to a single colum. I would

like to use a
macro to do this but if anyone can think of a way to do

it short of
deleting each cell individually my self that would help

too

thanks a million

Chuck


---
Message posted from http://www.ExcelForum.com/

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Removing rows featuring certain words

Thank you for your help,

i got them all removed :) :) :) :)

thanks a lot

Chuc

--
Message posted from http://www.ExcelForum.com

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
Removing duplicate rows Roger Bell New Users to Excel 2 January 4th 08 02:25 PM
Removing Rows for Printing Frick Excel Worksheet Functions 20 March 10th 06 11:53 PM
removing a space between words in a cell JenBasch Excel Worksheet Functions 3 September 20th 05 12:39 AM
Removing Blank Rows? andycharger[_35_] Excel Programming 3 June 24th 04 02:09 AM
trouble removing rows Spork Rhonewood[_4_] Excel Programming 1 June 23rd 04 04:46 PM


All times are GMT +1. The time now is 11:59 PM.

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

About Us

"It's about Microsoft Excel"