This is not the usual case where the array is defined within Excel. It is defined within VBA, and I need to find the proper value given a value found in a cell in Excel. In cell A1 I have the value DE000C5RQDA9. In B1 I want to return RXM1.
The actual array is more of a (0 to 9, 0 to XX) so do not think a dictionary is feasible. XX changes dynamically.
Example
Sub Test()
Dim arr(0 To 1, 0 To 1)
arr(0,0) = "RXM1"
arr(0,1) = "UBM1"
arr(1,0) = "DE000C5RQDA9"
arr(1,1) = "DE000C5RQDD3"
With Application
ActiveSheet.Cells(1, 2) = .Index(arr(0), .Match(ActiveSheet.Cells(1,1), arr(1), 0))
End with
End sub
arr(0)andarr(1)have no meaning for a 2D array. Then, you tried a code for an array with two rows and two columns. What the code should return for an array having 9 rows and 10 columns, supposing that the vale inCells(1, 2)matches the one in column 4, row 3?