Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default find multiple or by different words

Hello,

I would like to us the find function on a sheet to search for either of 2
words.
If I want to search for multiple words for example A and B I use:

..Find(what:="A" & "*" & "B",

But what do I use if i want to search for A OR B.
I know I can first search for A and subsequently for B but I would like to
use a single find function.

thanks in advance!
Lucas van Rijsewijk
Deurne, The Netherlands
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default find multiple or by different words

Hello Lucas

I don't think you can search for two strings at once.

Maybe this will help you.

Set found = Columns("A").Find(what:="A")
If found Is Nothing Then
Set found = Columns("A").Find(what:="B")
End If

Regards,
Per
Copenhagen, Denmark
"Lucas" skrev i meddelelsen
...
Hello,

I would like to us the find function on a sheet to search for either of 2
words.
If I want to search for multiple words for example A and B I use:

.Find(what:="A" & "*" & "B",

But what do I use if i want to search for A OR B.
I know I can first search for A and subsequently for B but I would like to
use a single find function.

thanks in advance!
Lucas van Rijsewijk
Deurne, The Netherlands


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default find multiple or by different words

Thanks for your reply Per!
Using the Set function also avoids an error message if nothing is found.

Thanks for helping out this newbie!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default find multiple or by different words

Hi Lucas

Thanks for your reply. I'm glad to help.

Best regards,
Per

"Lucas" skrev i meddelelsen
...
Thanks for your reply Per!
Using the Set function also avoids an error message if nothing is found.

Thanks for helping out this newbie!


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
Find multiple words in cell? Joe H. Excel Discussion (Misc queries) 4 September 11th 09 06:23 PM
How can I find all possible combinations of words? Yvonne Excel Worksheet Functions 4 June 6th 08 01:19 AM
FIND-COPY DIFFERENT WORDS WITH MACRO Spiros Excel Discussion (Misc queries) 1 September 27th 07 11:43 AM
Find & Replace Whole Words John Svendsen Excel Programming 9 September 11th 07 07:26 PM
Need to find the 1st two characters of the 1st two words Tom Excel Worksheet Functions 2 April 21st 05 02:10 AM


All times are GMT +1. The time now is 02:50 AM.

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"