Results 1 to 2 of 2
  1. #1
    Lounger
    Join Date
    Apr 2001
    Location
    Johannesburg
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help on cell comments (OXP)

    Is it possible to have a comment refer to a cell in a spreadsheet like you would do with a textbox.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Help on cell comments (OXP)

    Not directly, but you could use the Worksheet_Change event to update the comment each time the cell you want to refer to changes. For examply, if you want the comment for cell A1 to say something about its value, you could use this:

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("A1")) Is Nothing Then
    If Range("A1").Comment Is Nothing Then
    Range("A1").AddComment
    End If
    Range("A1").Comment.Text "The value of this cell is " & Range("A1")
    End If
    End Sub

    You must put this procedure in the worksheet module. Double click the worksheet in the Project Explorer (in the Visual Basic Editor) to get to this module.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •