Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.
Sub CountWord() Dim rng As Range, cell As Range Dim cellWords, totalWords As Integer, content As String Set rng = Selection cellWords = 0 totalWords = 0 For Each cell In rng If Not cell.HasFormula Then content = cell.Value content = Trim(content) If content = "" Then cellWords = 0 Else cellWords = 1 End If Do While InStr(content, " ") > 0 content = Mid(content, InStr(content, " ")) content = Trim(content) cellWords = cellWords + 1 Loop totalWords = totalWords + cellWords End If Next cell MsgBox totalWords & " words found in the selected range." End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.