selant
Board Regular
- Joined
- Mar 26, 2009
- Messages
- 109
I want to count how many "woman" values in my person array. Example as follows :
Can anybody share the solution for the function if there is ? Thank you.
Can anybody share the solution for the function if there is ? Thank you.
Code:
Private Sub CommandButton1_Click()
Dim person(1 To 5) As String
person(1) = "man"
person(2) = "woman"
person(3) = "woman"
person(4) = "man"
person(5) = "man"
Label1.Caption = "There are 2 women" 'calculate how many "woman" in person array
Label2.Caption = "There are 3 men" 'calculate how many "man" in person array
End Sub