title: Type mismatch error when assigning values to the array
body: <p>If the data is colored RED then store it in an array and display it in a MSGBOX. But not able to as I am getting type mismatch error.</p>
  
  <pre><code>             Name         Age        Sex
  
               John         18          m
               Rita         15          f -------&gt; RED   
               Phil         15          m -------&gt; Red
               Letty        15          f --------&gt; Red
               and so on  
  
  Sub msg()
  Dim dar() As Variant
  Dim j3 As Variant
  r3 = Range("a1").SpecialCells(xlCellTypeLastCell).Row
  For i3 = 1 To r3
      If (Range("E" &amp; i3).Interior.Color = RGB(255, 0, 0)) = True Then
          j3 = j3 + 1
  
          ' Getting Error at this line Type Mismatch error
          Set dar(i3) = Range("b" &amp; i3, "f" &amp; i3).Value
  
          MsgBox x
      End If
  Next i3   
  End Sub
  </code></pre>