select all comments

P

Pamela

How do you "select all comments" in a worksheet or workbook? Does anyone
have the VBA code for this?

Pam
 
D

Dave Peterson

Do you mean select all the cells that have comments in them?

if yes,

Option Explicit
Sub testme02()
Dim myRng As Range

With ActiveSheet
Set myRng = Nothing
On Error Resume Next
Set myRng = .Cells.SpecialCells(xlCellTypeComments)
On Error GoTo 0

If myRng Is Nothing Then
MsgBox "No cells with comments"
Else
myRng.Select
End If
End With
End Sub

Manually, you can select a single cell
edit|goto|special|check comments and click ok.
 
Top