This is driving me nuts...
I have two arrays. The first one is a 1D string array containing a Master List of possible defects, which is dynamically sized and filled based on a series of TRUE/FALSE entries by the user. I have VBA code that runs properly to create and populate this array, so typically it would look something like:
arrLeadMeasures(Mechanical, Electrical, Other)
The next array is a list of actual failures and is a 2D variant array called arrFailureModes that is also dynamically populated. Again this part of the VBA works okay. The array FailureModes typically looks something like:
Pump, Electrical, AirIntake, Other
Electrical, Electrical, Other, Tyres
etc etc
The part I am having problems with is I need to iterate through arrFailureModes and for each element I need to check if the current entry is contained anywhere within arrLeadMeasures. So far I have a shell of code which is:
I think I could take the current element of arrFailureModes and iterate through every element of arrLeadMeasures and use something like InStr to see if there is a match, but I think there must be a more elegant solution using something like IsInArray, perhaps? I've tried using the IsInArray syntax though and can't get it to work. In fact I can't get VBA to recognise IsInArray as a valid function to start with so getting nowhere with it!Please Login or Register to view this content.
Been pulling my hair out for over an hour now so thought it best to ask for some advice before I'm bald! :-)
Bookmarks