窗体上放个CommandButton和两个Label:
Private Sub Command1_Click()
Dim i As Integer, j As Integer, n As Integer
Label1.Caption = ""
Randomize
For i = 0 To 99
j = Int(Rnd * 99)
If j Mod 10 = 0 Then n = n + 1
Label1.Caption = Label1.Caption & " " & j
Next i
Label2.Caption = "个位数为0的元素个数: " & n
End Sub