Excel関数またはVBAの機能で、英文の単語数をカウントする関数ってありますか? I have a book. だと4を返すみたいな関数です。

Excel | Visual Basic67閲覧xmlns="http://www.w3.org/2000/svg">25

ベストアンサー

0

ID非公開

2021/10/16 14:35

その他の回答(1件)

0

Sub hoge() Dim re As Object, txt As String Set re = CreateObject("VBScript.RegExp") re.Global = True re.Pattern = "\S+\S" 'txt = ActiveCell.Value txt = "Mr. Wei, also known as ""King"", makes 1,450.5 dollars a week on average." Dim matches As Object, match As Object Set matches = re.Execute(txt) If matches.Count > 0 Then For Each match In matches Debug.Print match Next End If MsgBox matches.Count End Sub