VARIAS FUNÇÕES VBA EXCEL
CSN
Function cobinaçãoCSN(combinação As Range, ByVal valor_max As Long)
If IsArray(combinação) Then
arr = combinação '.Value2
C = UBound(arr, 2)
If UBound(arr, 1) > 1 Then cobinaçãoCSN = "apenas uma linha por combinação": Exit Function
Dim i As Long
Dim b As Double, dd As Double
b = 1
For i = 0 To C - 1
b = b * (valor_max - i) / (C - i)
Next