Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 2
Default Finding a charcter in a text string (take2)

I am trying to write a macro to find if an item exists within a cell and if so keep the row on which the cell resides cell or else delete it.

For example in the cell will be the text "London, Brimingham, Bristol" and I would like to put a search cname for London and have the row kept, but if I typed in Liverpool the row would be deleted.

The search name is on another worksheet in the spreadsheet.

The code I currently have is the following:

LRow = 1

While IsEmpty(Range("K" & CStr(LRow)).Value) = False
If Range("M" & CStr(LRow)).Value < Range("SM!D6") Then
Range("A" & LRow & ":T" & LRow).Select
Selection.Delete

' Decrement counter since row was deleted

LRow = LRow - 1

End If

LRow = LRow + 1

Wend

How can I get the code Range("SM!D6") to include a subset that is the search name?

SM is the other worksheet name and D6 is the cell where the search name is chosen.

Thank you in advance.

Bulent.
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
Finding a charcter in a text string caldog Excel Worksheet Functions 3 October 7th 07 04:37 AM
Finding specific text in string - Part II Hardip Excel Worksheet Functions 1 April 8th 06 02:20 PM
Finding specific text in a string Hardip Excel Worksheet Functions 5 April 8th 06 01:16 PM
Finding a text string w/in a Cell ricxl Excel Discussion (Misc queries) 12 March 20th 06 03:47 AM
Finding Specific Text in a Text String Peter Gundrum Excel Worksheet Functions 9 April 10th 05 07:21 PM


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