Materi Perkuliahan

Media bilangan Asli berurutan dengan VBA Excel

Dipublikasikan pada : 7 Februari 2021.

Private Sub CommandButton1_Click()

Dim x As Integer

Range(“C2”) = ten(5)

End Sub

Function ben(x)

Dim ans, i As Integer

ans = 0

For i = 1 To x

ans = ans + i

Next i

ben = ans

End Function

Function ten(x)

Dim ans, i As Integer

ans = 0

For i = 1 To x

ans = ans + ben(i)

Next i

ten = ans

End Function