Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,339
Default Fing a specific string in a Cell

Good news! and thanks for the feedback.

"loren.pottinger" wrote:

I'm an excel novice but I got it to work. Thank you so very much!

Toppers wrote:
It looks for any occurence of Account or New in any part of the string.

If you can post W/book to toppers<at johntopley.fsnet.co.uk and i'll have
another look. (Maybe be case-sensitive?)

"loren.pottinger" wrote:

Hey Toppers. Thanks for the reply. I attempted that but it didn't
exactly
work. I believe that I am leaving out some pertinent information. The
cells that I searching do not only have the words Account or New in
them. They are a part of a longer string where those words are just the

beginning of that string. For example: AccountSalary, or NewMachine.
What I want to do is delete the rows of associated with any cell in
column E that do not have the words Account or New as a part of the
value in the cell. Thank you for you help.

Toppers wrote:
Try (but backup data beforehand!):

Sub x()
Dim lastrow As Long, i As Long
With worksheets("Sheet1")
lastrow = .Cells(Rows.Count, "E").End(xlUp).Row
For i = lastrow To 1 Step -1
If Application.And(.Cells(i, "E") < "", InStr(1, .Cells(i, "E"),
"Account") = 0, InStr(1, .Cells(i, "E"), "New") = 0) Then
Rows(i).EntireRow.Delete
End If
Next i
End with
End Sub

" wrote:

I would like to search all the cells that are not empty in column E for
the words Account and New. If the cell does not have either of those
words in it, I would like to delete that entire row, go to the next
cell in column E and repeat this action until I arrive at an empty
cell.

Please help

LP






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
List File Properties - Author SS Excel Worksheet Functions 1 June 23rd 06 04:56 PM
Retrieving a specific cell from multiple worksheets TheShaolin Excel Worksheet Functions 5 June 9th 06 08:31 PM
Help with this conditional IF statement C-Dawg Excel Discussion (Misc queries) 3 May 15th 06 06:01 PM
Select cell containing specific text &return value from another ce plf100 Excel Worksheet Functions 4 November 16th 05 01:57 PM
how do I make a word typed in a cell go to a specific cell in anot Lmatarazzo Excel Discussion (Misc queries) 3 April 21st 05 04:29 AM


All times are GMT +1. The time now is 12:37 AM.

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"