Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Jean-Francois
 
Posts: n/a
Default delete row contains specific word in an macro

Hi, Im trying to delete row that contains specific expression like:

In row 444 column b contents (ESSO PRODUITS) i want to delete that row but i
have more then one row to find and delete.
  #2   Report Post  
Max
 
Posts: n/a
Default

Try this on a spare copy:
Do a Data Filter Autofilter on col B
Select from the droplist: ESSO PRODUITS
Select all the filtered rows (select the "blue" row headers)
Right-click Delete Row
Remove Autofilter
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
Jean-Francois wrote in message
...
Hi, Im trying to delete row that contains specific expression like:

In row 444 column b contents (ESSO PRODUITS) i want to delete that row but

i
have more then one row to find and delete.



  #3   Report Post  
Don Guillett
 
Posts: n/a
Default

You can use datafilterautofilterfilter on that column for that value
OR
a for/each macro to look, bottom up, for the value and then
..entirerow.delete

--
Don Guillett
SalesAid Software

"Jean-Francois" wrote in message
...
Hi, Im trying to delete row that contains specific expression like:

In row 444 column b contents (ESSO PRODUITS) i want to delete that row but

i
have more then one row to find and delete.



  #4   Report Post  
Jean-Francois
 
Posts: n/a
Default

Ok manually, but in a macro how would do that?

"Don Guillett" wrote:

You can use datafilterautofilterfilter on that column for that value
OR
a for/each macro to look, bottom up, for the value and then
..entirerow.delete

--
Don Guillett
SalesAid Software

"Jean-Francois" wrote in message
...
Hi, Im trying to delete row that contains specific expression like:

In row 444 column b contents (ESSO PRODUITS) i want to delete that row but

i
have more then one row to find and delete.




  #5   Report Post  
Dave Peterson
 
Posts: n/a
Default

You could record a macro when you did the filtering and deleting to get your
code.

or looping (like Don's second suggestion):

Option Explicit
Sub testme()

Dim FirstRow As Long
Dim LastRow As Long
Dim iRow As Long

With Worksheets("sheet1")
FirstRow = 2 'headers in 1???
LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row
For iRow = LastRow To FirstRow Step -1
If UCase(.Cells(iRow, "B").Value) = UCase("ESSO PRODUITS") Then
.Rows(iRow).Delete
End If
Next iRow
End With

End Sub



Jean-Francois wrote:

Ok manually, but in a macro how would do that?

"Don Guillett" wrote:

You can use datafilterautofilterfilter on that column for that value
OR
a for/each macro to look, bottom up, for the value and then
..entirerow.delete

--
Don Guillett
SalesAid Software

"Jean-Francois" wrote in message
...
Hi, Im trying to delete row that contains specific expression like:

In row 444 column b contents (ESSO PRODUITS) i want to delete that row but

i
have more then one row to find and delete.





--

Dave Peterson
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
Open Word Doc From Excel Macro MATT Excel Discussion (Misc queries) 4 December 14th 04 12:09 AM
Macro to find and delete all FALSE statements Woody13 Excel Discussion (Misc queries) 3 December 8th 04 11:16 PM
Hyperlink to word document problem JS Links and Linking in Excel 0 December 8th 04 10:54 PM
getting specific info from a word document into excel smintey Excel Discussion (Misc queries) 3 December 8th 04 08:20 PM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM


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