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 cells containing multiple values in random order

Hello,

I'm using the find function to search for a single cell containing multiple
predefined words. For example all cells containing the letter A and B, using
the following code:

Set X = Selection.Find(what:="A" & "*" & "B")

But this search only finds cells that conatin A and B in that particular
order. Thus a cell containing BA is not found! Is there a way to adapt the
find statement in such a way the order of the words in a cell are no longer
dependent on the search result?

thanks in advance,

Lucas van Rijsewijk
Deurne, The Netherlands
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Find cells containing multiple values in random order

Sub lucas()
Set X = Selection.Find(what:="A" & "*" & "B")
Set Y = Selection.Find(what:="B" & "*" & "A")
Set X = Union(X, Y)
End Sub

--
Gary''s Student - gsnu200799


"Lucas" wrote:

Hello,

I'm using the find function to search for a single cell containing multiple
predefined words. For example all cells containing the letter A and B, using
the following code:

Set X = Selection.Find(what:="A" & "*" & "B")

But this search only finds cells that conatin A and B in that particular
order. Thus a cell containing BA is not found! Is there a way to adapt the
find statement in such a way the order of the words in a cell are no longer
dependent on the search result?

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 cells containing multiple values in random order

Thanks you for your quick solution! Very much appreciated!
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
rearrange cells in random order Amy B Excel Discussion (Misc queries) 1 April 20th 09 02:08 AM
is it possible for excel to take several cells in random order and confused in Iowa Excel Discussion (Misc queries) 1 January 7th 08 03:17 AM
find values in multiple cells and paste row values izzyt1972 Excel Discussion (Misc queries) 5 December 26th 07 10:14 PM
How can I sort a selection of cells into random order? IanS Excel Discussion (Misc queries) 2 June 14th 07 12:31 PM
Find values from cells in multiple sheets asubramaniam Excel Worksheet Functions 2 July 24th 05 01:50 PM


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