Re : Somme partielle sur une même ligne
bonsoir plusnultumeurt (ouf j'ai dépassé ce stade ), Gorfael
je vient de trouver ceci ?????????
Sub comptage()
'AV, mpfe
For Each cel In Range("A7:X7")
For i = 1 To Len(cel)
If Mid(cel, i, 1) = "A" Then cpt = cpt + 1
Next
Next
MsgBox cpt
End Sub
Function NbLettres(plage As Range, Lettre$, _
Optional Casse As Boolean = True)
'fs, mpfe
Dim cell As Range
NbLettres = 0
For Each cell In plage
If Not cell.Text = "" Then
If Casse = False Then
NbLettres = NbLettres + UBound(Split(LCase(cell.Text), LCase(Lettre)))
Else
NbLettres = NbLettres + UBound(Split(cell.Text, Lettre))
End If
End If
Next
End Function
Function NbreLettres(laPlage As Range, laLettre As String, laCasse As Boolean)
'AV, mpfe
Dim cel As Range
For Each cel In laPlage
For i = 1 To Len(cel)
If laCasse = True Then If Mid(cel, i, 1) = laLettre Then _
NbreLettres = NbreLettres + 1
If laCasse = False Then
If Mid(cel, i, 1) = LCase(laLettre) Or Mid(cel, i, 1) = laLettre _
Then NbreLettres = NbreLettres + 1
End If
Next
Next
End Function
mais je n'ai pas testé
donc a voir