Private Sub Command1_Click()
Dim i As Integer, j As Integer, sum As Integer
Dim n As Integer
n = Val(Text1.Text)
sum = 0
List1.Clear
For i = 1 To n ' ①
j = i - 1
Do While sum <= n ' ②
j = j + 1
sum = sum + j
Loop
If sum = n Then
List1.AddItem Str(i) & " + ... +" & Str(j) & "=" & Str(n)
End If
sum = 0
Next i
End Sub
① ②