Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Existence of Comments? (newbie)

Status
Not open for further replies.

gersh

Technical User
Mar 11, 2002
2
US
How can I test in VB for the existence of a comment in a cell? I have some code that copies over comments to adjacent cells but it fails if no comment exists.

Thanks!
 
Hi,
Comments are in a collection. You can loop thru the collection and see if the address of any comment is the address you are "addressing" so to speak...
Code:
    For Each Comment In ActiveSheet.Comments
        MsgBox Comment.Parent.Address
    Next
Hope this helps :) Skip,
metzgsk@voughtaircraft.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top