Thread
:
can I test if a variable is a member of an array
View Single Post
#
1
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\)[_2621_]
external usenet poster
Posts: 1
can I test if a variable is a member of an array
If the array you are looping through is a one-dimensional String array, then
look up the Filter function in the help files.
Rick
"Andy Clarke" <Andy
wrote in message
...
I have a very large spreadsheet containing raw data for the whole world. I
am
only interested in certain countries, and I have to group the countries
into
market groupings, such as Benelux for Belgium, Netherlands and Luxembourg.
I have set up an array containing all the countries required (70 of them),
and several other arrays for each market grouping.
As I read through the spreadsheet, row by row, I want to test if the
country
is one that I am interested in. Therefore, it would be best if there was a
function to test if the country is a member of my countries array.
At the moment, I am looping and testing if each country is member1, then
member 2, etc. Therefore, there is a 70-stage loop for each row in the
spreadsheet. And then I test again to see which market grouping they
belong
to ...
There must be a much more efficient way of doing this.
Any ideas?
Thanks
Reply With Quote
Rick Rothstein \(MVP - VB\)[_2621_]
View Public Profile
Find all posts by Rick Rothstein \(MVP - VB\)[_2621_]