Bonjour
J'essaie de faire une fonction personnalisée, appelée par VBA
Plage peut prendre soit la valeur tableau, soit la valeur range
j'ai ce message:
<<< imcompatibilité de type, tableau défini par l'utilisateur attendu >>>
merci
Public Function Compte_Tranche_2(Plage As Range, ByRef Plage(), t_1 As Integer, t_2 As Integer) As Long
If IsArray(Plage) = True Then
For i = 1 To UBound(Plage)
Plage(i) = i
If i.Value >= t_1 And i.Value <= t_2 Then
Compte_Tranche_2 = Compte_Tranche_2 + 1
Next
'""""""""""""""""""""""""""""""""""""
Else
Dim C As Range
Compte_Tranche_2 = 0
For Each C In Plage
If C.Value >= t_1 And C.Value <= t_2 Then
Compte_Tranche_2 = Compte_Tranche_2 + 1
End If
Next C
End Function
J'essaie de faire une fonction personnalisée, appelée par VBA
Plage peut prendre soit la valeur tableau, soit la valeur range
j'ai ce message:
<<< imcompatibilité de type, tableau défini par l'utilisateur attendu >>>
merci
Public Function Compte_Tranche_2(Plage As Range, ByRef Plage(), t_1 As Integer, t_2 As Integer) As Long
If IsArray(Plage) = True Then
For i = 1 To UBound(Plage)
Plage(i) = i
If i.Value >= t_1 And i.Value <= t_2 Then
Compte_Tranche_2 = Compte_Tranche_2 + 1
Next
'""""""""""""""""""""""""""""""""""""
Else
Dim C As Range
Compte_Tranche_2 = 0
For Each C In Plage
If C.Value >= t_1 And C.Value <= t_2 Then
Compte_Tranche_2 = Compte_Tranche_2 + 1
End If
Next C
End Function