Sub NombreMots() Dim WordCnt As Long Dim plagecell As Range Dim S As String Dim N As Long For Each plagecell In ActiveSheet.UsedRange.Cells S = Application.WorksheetFunction.Trim(plagecell.Text) N = 0 If S <> vbNullString Then N = Len(S) - Len (Replace(S, "", "")) + 1 End If WordCnt = WordCnt + N Next plagecell MsgBox "There are total " _ & Format(WordCnt, "#,##0") & " mots dans la feuille de calcul actuelle" End Sub
Il peut vous aider à compter tous les mots d’une feuille de calcul.