The information in this article applies to:
SUMMARYMicrosoft Excel 98 Macintosh Edition no longer uses cell notes; instead, Excel 98 uses cell comments. Consequently, the macro code you use to determine whether a cell contains a comment is different. This article contains information about programmatically determining whether a cell contains a comment and about compatibility with earlier versions of Microsoft Excel. MORE INFORMATIONMicrosoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web: http://www.microsoft.com/support/supportnet/overview/overview.asp Checking for Cell NotesIn earlier versions of Microsoft Excel, you can determine whether the active cell contains a cell note by running a macro that is similar to the following example:
If you run this macro and the active cell does not contain a cell note, a
message box displays a "cell has no note" message.
NOTE: You can successfully run this macro in Microsoft Excel 98 even though all cell notes are converted to cell comments when you open a Microsoft Excel version 5.0 file in Microsoft Excel 98. To ensure that the macro works in all versions of Microsoft Excel that support Visual Basic for Applications, use a macro that is similar to the example provided in this article. Checking for Cell CommentsTo ensure future compatibility with Microsoft Excel and specifically with cell comments, you may want to use the Comment property in the Visual Basic macro. In the following macro, the Comment property for a Range object returns a Comment object. If the active cell does not have a comment, the Comment property returns Nothing.
NOTE: The Has_Comment macro does not work in earlier versions of Microsoft
Excel.
REFERENCES
For more information about cell comments, from the Visual Basic Editor,
click the Office Assistant, type comment, click Search, and then click to
view "Comment Property."
Q176476 OFF: Office Assistant Not Answering Visual Basic Questions Additional query words: vbe XL98
Keywords : kbprg kbdta kbdtacode xlvbahowto xlvbainfo OffVBA |
Last Reviewed: November 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |