Revise your code to this.
Option Explicit
Sub main()
Public rIndex As Integer
For rIndex = 1 To 17
If Worksheets("Sheet2").Cells(rIndex, 1).Value = "EE16" Then
MsgBox Worksheets("Sheet2").Cells(7, 2) &
Worksheets("Sheet2").Cells(7, 3)
End If
Next rlndex
End Sub