Count Less than Average Problem Code

Private Sub cmdAverageCountLess_Click()

    Dim intArray(2), intTotal, intIntegerValue As Integer

    Dim intIndex, intAverage, inCountLess As Integer

           

    intTotal = 0

       

    For intIndex = 0 To 2

        intIntegerValue = Val(InputBox("Enter Integer value", _

            "Integer Value", "10"))

        intArray(intIndex) = intIntegerValue

        intTotal = intTotal + intIntegerValue

    Next intIndex

   

    intAverage = intTotal / intIndex

    inCountLess = 0

   

    For intIndex = 0 To 2

        If intArray(intIndex) < intAverage Then

            inCountLess = inCountLess + 1

        End If

    Next intIndex

   

    MsgBox "Average is: " & intAverage, vbOKOnly, "Average"

    MsgBox "Number of Integers less than the Average: " & inCountLess, _

        vbOKOnly, "Count less than Average"

End Sub