Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello. I'm attempting to cycle through an array, looking for a color (sPat).
If found, return the corresponding iColorIndex number. For example, if sPat = "Dark Red", then iColorIndex should be 9. Where am I going wrong (probably in the variable types)? Thanks. Jason Sub FindIndex() Dim ColorArray(1 To 2) Dim sPat As String Dim iColorIndex As Integer sPat = "Dark Red" ColorArray(1) = Array(1, 9, 3) ColorArray(2) = Array("Black", "Dark Red", "Red") For j = 0 To 2 If ColorArray(2)(j) = sPat Then iColorIndex = ColorArray(1)(j) End If Exit For Next Debug.Print iColorIndex End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Syntax for multidimensional array | Excel Programming | |||
Sort MultiDimensional Array | Excel Programming | |||
Referencing multidimensional array | Excel Programming | |||
Multidimensional Array | Excel Programming | |||
MAX of Multidimensional Array | Excel Programming |