Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Delete rows with common element

Hello,

Is there a way to delete all rows that contain a common text element (i.e.
"Holiday"). The remaining information in the records may differ from every
other row.--
Thank-you and all suggestions are appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Delete rows with common element

yes. More info. where in the row? Only the word in the cell or holiday sss
in the same cell?

--
Don Guillett
SalesAid Software

"Anauna" wrote in message
...
Hello,

Is there a way to delete all rows that contain a common text element (i.e.
"Holiday"). The remaining information in the records may differ from

every
other row.--
Thank-you and all suggestions are appreciated.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default Delete rows with common element


Try bellow code:-

Sharad

Sub DelRows()
Dim uRange As Range, delRange As Range
Set uRange = Worksheets("Sheet_Name_Here").UsedRange
Set delRange = uRange.Cells(uRange.Rows.Count + 1, 1).EntireRow
For Each c In uRange.Cells
If InStr(1, c.Value, "Holiday") 0 Then
Set delRange = Union(delRange, c.EntireRow)
End If
Next c
delRange.Delete
End Sub

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Delete rows with common element

The text to be used as the "trigger" is located in Column B for each record.
If the key text phrase is located in this cell I would like the entire record
(row) to be deleted.
I have tried the advanced filter but it requires all the each record to be
identical.

Thank-you
"Don Guillett" wrote:

yes. More info. where in the row? Only the word in the cell or holiday sss
in the same cell?

--
Don Guillett
SalesAid Software

"Anauna" wrote in message
...
Hello,

Is there a way to delete all rows that contain a common text element (i.e.
"Holiday"). The remaining information in the records may differ from

every
other row.--
Thank-you and all suggestions are appreciated.




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
ADDING COLUMNS FOR COMMON ROWS JGAVIGAN Excel Discussion (Misc queries) 2 April 9th 10 03:06 AM
Sum Value of rows based on two common fields jdg Excel Worksheet Functions 5 June 30th 09 09:40 AM
Comparing two different sets of data with common element tutaref Excel Worksheet Functions 1 April 5th 07 08:24 PM
Common Spacing of Rows rajeev Excel Worksheet Functions 9 May 12th 05 09:19 AM
Deleting rows containing common data gcotterl Excel Discussion (Misc queries) 1 January 4th 05 12:58 AM


All times are GMT +1. The time now is 05:20 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"