Private Function Even(intData() As Integer) As Long
Dim i As Long, sum As Long, ic As Long
sum = 0
ic = 0
For i = LBound(intData) To UBound(intData)
If ((intData(i) Mod 2) = 0) Then
sum = sum + intData(i)
ic = ic + 1
End If
Next
Even = sum / ic
End Function
Private Sub Form_Click()
Dim intData(9) As Integer, i As Integer
Randomize
Me.Cls
For i = 0 To 9
intData(i) = 1 + CInt(99 * Rnd)
Next
Me.Print Even(intData)
End Su