In that case, one way I can think of is
Code:'Declared Array Dim x(5) As String Dim iCounter As Integer Private Sub Command1_Click() 'Assigned Values x(0) = "India": x(1) = "China": x(2) = "Brazil": x(3) = "Russia": x(4) = "Yemen" 'Looped Through Array For iCounter = 0 To UBound(x) - 1 If x(iCounter) = "China" Then Debug.Print "Hello China" End If Next End Sub





Reply With Quote