LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 634
Default reading inside a text string

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
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
Searching for a string of text inside a column Steve W. Excel Worksheet Functions 5 March 5th 09 04:52 PM
Creating a text string by reading content in multiple cells smaruzzi Excel Worksheet Functions 3 February 8th 07 05:12 PM
Visual Basic 6 - String Reading V Govindan Excel Discussion (Misc queries) 2 December 7th 06 03:56 PM
Need macro to insert text string while inside cell (formula) BrianB Excel Discussion (Misc queries) 0 May 31st 05 03:18 PM
find a string inside another string MarkS Excel Programming 1 January 13th 04 02:55 AM


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

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"