Solved

programmatically read a cell comment

Posted on 1998-12-07
2
225 Views
Last Modified: 2006-11-17
i want to programmatically read a cell comment (in VB)

to write the comment, i can do, for example:
Range("A1").Comment.TEXT TEXT:="user:" & Chr(10) & "some words"

but there doesn't seem to be anything to read it back.
0
Comment
Question by:mickeydog
2 Comments
 
LVL 3

Accepted Solution

by:
frazer earned 50 total points
ID: 1614885
Hi,

This will assign the variable to 'a' and then display it in a message box....

Sub hello()
    Dim XL As New Excel.Application
    Dim wbk As Workbook
    Dim a As String
    Set wbk = XL.Workbooks.Add
    Range("A1").AddComment "Hello"
    a = Range("A1").Comment.Text
    MsgBox a
    Set wbk = Nothing
    Set XL = Nothing
End Sub


Hope this helps

Frazer
0
 

Author Comment

by:mickeydog
ID: 1614886
thanks!
hope there's no grading mixup this time!

0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some time ago I was asked to create a VBA function that would calculate a check digit for an input number, using the following procedure: First, sum up all the individual digits in the number If that sum value has more than one digit, then sum up …
Outlook Free & Paid Tools
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

806 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question