> In my Word 2003 macro project a dimmed array is being build based on a matrix
> in an Excel workbook.
[quoted text clipped - 5 lines]
> When the specific row is being found then I'd like to use the data as
> variables in the rest of the macro
Use the same code you already have to build the array, then search the
array. Here is some simple code to get you going (Of course, I have to build
an array just to show you how to search the array... You would repalce the
array building code I have with your own and modify the searching code
appropriately):
Sub FindArrayValue()
Dim strArray(2, 2, 2) As String
Dim i As Long
Dim j As Long
Dim k As Long
Dim strValue As String
Dim str0 As String
Dim str1 As String
Dim str2 As String
i = 0
j = 0
k = 0
For i = 0 To 2
For j = 0 To 2
For k = 0 To 2
strArray(i, j, k) = i & "_" & j & "_" & k
Next
Next
Next
strValue = InputBox("What Variable are you looking for (""x_y_z"" where
numbers must be between 0 and 2)?", "Get value")
i = 0
j = 0
k = 0
For i = 0 To 2
For j = 0 To 2
For k = 0 To 2
If strArray(i, j, k) = strValue Then
str0 = strArray(i, j, 0)
str1 = strArray(i, j, 1)
str2 = strArray(i, j, 2)
Exit For
End If
Next
Next
Next
MsgBox "The three variables associated with """ & strValue & """ are """ _
& str0 & """, """ & str1 & """ and """ & str2 & """.", _
vbInformation, "Results"
End Sub