Group: microsoft.public.word.vba.general
From: "Klaus Linke"
Date: Wednesday, February 13, 2008 10:24 AM
Subject: Re: Search array and return position?

"Ed from AZ" wrote:
> Is there a built-in way to search through each value position of an
> array (string) for a match to another string, and when a mtach is
> found return the array position of the match? So if I'm looking ot
> match "here" and Array(5) is "here" then I get a return of "5"?


You might look whether a Scripting.Dictionary is more appropriate for your
needs than an array.
Dim myDic As New Scripting.Dictionary
myDic.Add Key:="here", Item:="5"
Debug.Print myDic(Key:="here")

Regards,
Klaus


Safety Articles | Usenet Groups | Usenet News | Bluegrass