次の機能を使用して結果を得ることができます。それはハイライトで一致カウントを返します。
Public Function highlightrange(texttocheck As String, r As Range)
Dim totalmatchcount As Integer
Dim matchcount As Integer
r.Cells.Font.ColorIndex = 0
matchcount = 0
texttocheck = Replace(texttocheck, " ", "")
str1 = Split(texttocheck, " ")
str2 = UBound(str1)
For i = 1 To r.Cells.Count
For j = 0 To str2
If InStr(r.Cells(i), str1(j)) > 0 Then
matchcount = matchcount + 1
End If
Next j
If matchcount = str2 + 1 Then
r.Cells(i).Font.ColorIndex = 8
totalmatchcount = totalmatchcount + 1
End If
matchcount = 0
Next i
highlightrange = totalmatchcount
End Function
Excel関数は、セルを強調表示し、物事の一種ではありません。セルのコンテンツに基づいて自動的にセルを強調表示する条件付き書式設定ルールを使用することができます。書式設定ルールは特定のセルにリンクできますが、セルを選択するだけで規則に使用されるセルは変更されません。 VBAソリューションはありますが、関数ではなくイベントハンドラ( 'Worksheet_SelectionChange')になります。 –