Hello,
I am using the following code to transfer comments to a separate worksheet.
However, I get an error when no comments exist.
Can someone tell me the proper syntax to test for comments?
Thanks.
I am using the following code to transfer comments to a separate worksheet.
However, I get an error when no comments exist.
Can someone tell me the proper syntax to test for comments?
Thanks.
Code:
Sub Save_Comments()
For Each oCell In Range("al1:al1000").SpecialCells(xlCellTypeComments)
Select Case oCell.Comment.Text
Case Is <> ""
Sheets("sheet2").Range("a65536").End(xlUp).Offset(1, 0) = oCell.Offset(0, -34)
Sheets("Sheet2").Range("a65536").End(xlUp).Offset(0, 1) = oCell.Comment.Text
End Select
Next
For Each oCell In Range("al1:al1000").SpecialCells(xlCellTypeComments)
oCell.ClearComments
Next
End Sub