Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Your fingers are too fast Frank - Missed that first pair of quotes round the
'Old':- If InStr (Cells(RowNdx, "A").Value,Old") Then :-) -- Regards Ken....................... Microsoft MVP - Excel Sys Spec - Win XP Pro / XL 00/02/03 ---------------------------------------------------------------------------- It's easier to beg forgiveness than ask permission :-) ---------------------------------------------------------------------------- "Frank Kabel" wrote in message ... Hi try the following for column A Sub delete_rows() Dim RowNdx As Long Dim LastRow As Long LastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).row For RowNdx = LastRow To 1 Step -1 If InStr (Cells(RowNdx, "A").Value,Old") Then Rows(RowNdx).Delete End If Next RowNdx End Sub -- Regards Frank Kabel Frankfurt, Germany what I need is a sub that will read all the cells in a specified column and delete rows if the word "Old" in the cell anywhere. such as big old car? Is that possible. I have a nice sub that deletes rows according to contents, but I don't know how to make it look between words --- Message posted from http://www.ExcelForum.com/ --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.595 / Virus Database: 378 - Release Date: 25/02/2004 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Searching for a string of text inside a column | Excel Worksheet Functions | |||
Creating a text string by reading content in multiple cells | Excel Worksheet Functions | |||
Visual Basic 6 - String Reading | Excel Discussion (Misc queries) | |||
Need macro to insert text string while inside cell (formula) | Excel Discussion (Misc queries) | |||
find a string inside another string | Excel Programming |