Option Explicit Public Function CountComment(ByVal Target As Range, ByVal Comment As String) As Integer Dim rg As Range Dim sum As Integer Dim tmp As String For Each rg In Target If Not rg.Comment Is Nothing Then tmp = rg.Comment.Text If tmp Like "*" & Comment & "*" Then sum = sum + 1 End If Next CountComment = sum End Function