Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 27th, 2003, 03:13 PM
Authorized User
 
Join Date: Dec 2003
Location: Brussels, , Belgium.
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default Check comment or not

Hello all,
Is there a way to check if there is a comment or not set on a cell?
I tried several ways but there were unsuccessful.
Many Thanx
St├ęphane
 
Old January 9th, 2004, 06:20 PM
Registered User
 
Join Date: Jan 2004
Location: Versailles, , France.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello,

You can try the following:

Function CheckComment(CC As Range) As Boolean
    Dim Com As Comment

    ' trap error
    '
    On Error Resume Next
    '
    ' try to get comment if any
    '
    Set Com = CC.Comment
    '
    ' Restore error management
    '
    On Error GoTo 0
    '
    ' Check if comment
    '
    If Com Is Nothing Then
        CheckComment = False
    Else
        CheckComment = True
    End If
End Function

Hope this will help.
Regards.
Patdil





Similar Threads
Thread Thread Starter Forum Replies Last Post
download 1.3 javadoc comment hombre BOOK: Beginning Java 2 0 December 18th, 2007 11:57 AM
Removing comment coding Ray Pinnegar Access 2 November 15th, 2004 02:44 PM
Help me about write a comment. fujinova JSP Basics 0 October 1st, 2003 08:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.