Wednesday, August 10, 2011

Count Comments On A Worksheet

How to Count the comment on a Worksheet :


Sub CountComment()
On Error Resume Next
Dim cmt As Comment
Dim count As Integer
count = 0
For Each cmt In ActiveSheet.Comments
count = count + 1
Next cmt
If count = 0 Then
MsgBox "There is no Comment in Active Worksheet"
Else
MsgBox "Total Comment in active sheet = " & count
End If
End Sub

No comments: