Skip to content

Instantly share code, notes, and snippets.

@gsimard
Created March 29, 2018 18:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gsimard/5458738c10714cb0efabf6cef61a1ab7 to your computer and use it in GitHub Desktop.
Save gsimard/5458738c10714cb0efabf6cef61a1ab7 to your computer and use it in GitHub Desktop.
Fonction récursive VBA
Public Function nbrVoituresSurCercle(ByVal i As Long) As Long
nbrVoituresSurCercle = i
End Function
Public Function nbrVoituresTotal(ByVal i As Long) As Long
If i = 1 Then
nbrVoituresTotal = nbrVoituresSurCercle(1)
Else
nbrVoituresTotal = nbrVoituresSurCercle(i) + nbrVoituresTotal(i - 1)
End If
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment