Private Sub Command1_Click()
Dim s As Integer, i As Integer, j As Integer, n As Integer
n = 1
For i = 2 To 1000
s = 0
For j = 1 To i \ 2
If i Mod j = 0 Then s = s + j
Next j
If i = s Then n = n + 1
Next i
Print n
End Sub