Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Find text - worksheet function or macro?

I have text in A2-A1500. All of the cells contain long strings of text. I
want to identify which cells contain "ItemA" or "ItemB". As I am weak in VB
I would prefer to use worksheet functions if possible. I tried using FIND
but that returns #VALUE! if the string does not exist. All suggestions
welcome!
  #2   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Find text - worksheet function or macro?

One way ..

Put in B2:
=SUMPRODUCT(--ISNUMBER(FIND({"ItemA","ItemB"},A2)))0
Copy down as far as required to B1500

Col B returns TRUE if either: "ItemA" or "ItemB", or both, are found.
Just autofilter col B for TRUE to get all the lines

Replace FIND with SEARCH
if you don't want the searching to be case sensitive
(SEARCH is not case sensitive)
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"sebh007" wrote:
I have text in A2-A1500. All of the cells contain long strings of text. I
want to identify which cells contain "ItemA" or "ItemB". As I am weak in VB
I would prefer to use worksheet functions if possible. I tried using FIND
but that returns #VALUE! if the string does not exist. All suggestions
welcome!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Find text - worksheet function or macro?

Fantastic! Thank you so much!

S

"Max" wrote:

One way ..

Put in B2:
=SUMPRODUCT(--ISNUMBER(FIND({"ItemA","ItemB"},A2)))0
Copy down as far as required to B1500

Col B returns TRUE if either: "ItemA" or "ItemB", or both, are found.
Just autofilter col B for TRUE to get all the lines

Replace FIND with SEARCH
if you don't want the searching to be case sensitive
(SEARCH is not case sensitive)
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"sebh007" wrote:
I have text in A2-A1500. All of the cells contain long strings of text. I
want to identify which cells contain "ItemA" or "ItemB". As I am weak in VB
I would prefer to use worksheet functions if possible. I tried using FIND
but that returns #VALUE! if the string does not exist. All suggestions
welcome!

  #4   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Find text - worksheet function or macro?

Pleasure` !
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"sebh007" wrote in message
...
Fantastic! Thank you so much!

S



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Find text - worksheet function or macro?

Sorry, but there's more. I get the resuLt 'TRUE' or 'FALSE' which is a great
help but there are other tests I wish to apply elsewhere so I need to be able
to say the equivalent of =IF(A2='TRUE',1,0) or similar. Although the display
in A2 is definitely 'TRUE' Excel doesn't recognise it as such. Is there any
way of utilising the 'TRUE' that is being returned in A2 please?

Thanks in advance.

S



"Max" wrote:

Pleasure` !
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"sebh007" wrote in message
...
Fantastic! Thank you so much!

S






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Find text - worksheet function or macro?

It's OK thanks - cracked it! Just bracket it with an IF and I'm there -
sorry to trouble you.

S

"sebh007" wrote:

Sorry, but there's more. I get the resuLt 'TRUE' or 'FALSE' which is a great
help but there are other tests I wish to apply elsewhere so I need to be able
to say the equivalent of =IF(A2='TRUE',1,0) or similar. Although the display
in A2 is definitely 'TRUE' Excel doesn't recognise it as such. Is there any
way of utilising the 'TRUE' that is being returned in A2 please?

Thanks in advance.

S



"Max" wrote:

Pleasure` !
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"sebh007" wrote in message
...
Fantastic! Thank you so much!

S




  #7   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Find text - worksheet function or macro?

Glad you got it sorted out !
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
sebh007 wrote:
It's OK thanks - cracked it! Just bracket it with an IF and I'm there -
sorry to trouble you.

S


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
calling worksheet function from a macro Joe Farruggio Excel Worksheet Functions 3 November 20th 06 10:01 PM
Macro: Find and replace Bertie Excel Discussion (Misc queries) 1 May 29th 06 02:01 PM
Sorting - Macro or worksheet function Danny Excel Worksheet Functions 1 August 2nd 05 09:17 PM
hide a worksheet so that a macro can still find it frendabrenda1 Excel Worksheet Functions 1 June 17th 05 04:30 PM
Macro or Function to make text size to suite text Length? lbbss Excel Discussion (Misc queries) 4 December 14th 04 07:53 PM


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