Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) | Reguli | Inregistrare | Login

POZE MRRRR'S FORUM (VIEW ONLY)

Nu sunteti logat.
Nou pe simpatie:
angy_2
Femeie
21 ani
Constanta
cauta Barbat
21 - 63 ani
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides / [WORD] Count Charactes and Words in Selection [VBA] Moderat de TRaP, TonyTzu
Autor
Mesaj Pagini: 1
TRaP
Moderator

Inregistrat: acum 6 ani
Postari: 748
You have to select a paragraph / sentence / some words / characters, then run the following code and you will get a message box telling you how many words, characters with spaces and characters without spaces are in your selection:



Sub GetWordsCount_Selection()

Dim W, Ch, ChSp As Long

    W = Selection.Range.ComputeStatistics(wdStatisticWords)
    Ch = Selection.Range.ComputeStatistics(wdStatisticCharacters)
    ChSp = Selection.Range.ComputeStatistics(wdStatisticCharactersWithSpaces)

MsgBox "The selection has:" & vbCrLf & _
        " - " & W & " words." & vbCrLf & _
        " - " & ChSp & " characters with spaces." & vbCrLf & _
        " - " & Ch & " characters without spaces."

End Sub


Source:

Modificat de TRaP (acum 5 ani)


pus acum 5 ani
   
Pagini: 1  

Mergi la