ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Range Search (https://www.excelbanter.com/excel-programming/286145-range-search.html)

Ray Batig

Range Search
 
I have some data in the following format:

D E F G H I J K L .... more
9 a b f f f c c d f

I had some code that would search through the range and write the first
occurrence of the data into a new cell and then increment a cell to the
right. This all worked fine until I got a new set of data in which I had an
'a' in cell L9. So my output showed both a's. I really wanted only one
output of 'a' no matter how many times it showed up in any order.

How would you code a search routine for my new case?

Merry Christmas. Thanks in advance for your help!

Ray




shockley

Range Search
 
Ray,

You don't say what type of code you're using for your search, but the Find
method in vb has an option to match the case or not. Alternatively, you
could assign a variable to the LCase value of the cells contents before
checking it. Or, convert the entire range to lower case before searching.

HTH,
Shockley

"Ray Batig" wrote in message
link.net...
I have some data in the following format:

D E F G H I J K L .... more
9 a b f f f c c d f

I had some code that would search through the range and write the first
occurrence of the data into a new cell and then increment a cell to

the
right. This all worked fine until I got a new set of data in which I had

an
'a' in cell L9. So my output showed both a's. I really wanted only one
output of 'a' no matter how many times it showed up in any order.

How would you code a search routine for my new case?

Merry Christmas. Thanks in advance for your help!

Ray







All times are GMT +1. The time now is 09:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com