Why do I get "Run-Time error '1004': Application-defined or Object-
defined error" when using an array variable:
Option Explicit
Public rIndex As Integer
Sub main()
For rIndex = 0 To 17
If Worksheets("Sheet2").Cells(rIndex, 1).Value = "EE16" Then
MsgBox Worksheets("Sheet2").Cells(7, 2) & Worksheets("Sheet2").Cells
(7, 3)
Next
End Sub