Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Array Problem, Help Please.
the following macro has to compare, cell by cell, in a
certain range, the cell value with a list of values, but it is not working properly because it seem there is a match in all three cells, but the match is only in Range(A2), because "C" = "C" Where is the problem ??? Thanks for Your suggestion. Robert. example ' A ---'---------------- 1 ' t -------------------- 2 ' C -------------------- 3 ' 7 -------------------- Sub tester_1() Dim cell As Range For Each cell In Range("a1:a3") Dim i As Integer Dim x As Variant x = Array("A", "B", "C", "D", "E") For i = -1 To 4 On Error Resume Next MsgBox x(i) If cell.Value = x(i) Then cell.Interior.ColorIndex = 4 MsgBox " Match in " & cell.Address & vbNewLine & cell.Value & " = " & x(i) End If Next i Next cell End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
3D Array Problem | Excel Worksheet Functions | |||
Problem with array ref (I think!) | Excel Worksheet Functions | |||
Array problem, I think.. | Excel Worksheet Functions | |||
Array problem - TIA | Excel Worksheet Functions | |||
Array Problem | Excel Discussion (Misc queries) |