Cell Notes

mikeymay

Well-known Member
Joined
Jan 17, 2006
Messages
1,600
Office Version
  1. 365
Platform
  1. Windows
Is there a way to extract a cell note via VBA?

Rather than using Comments, Notes will be used as when I try to use the CommentThreaded command my workbook crashes so I'm assuming there is a bug somewhere causing this.

I also want to add a text string to a cell as a Note as well if this is possisble.


Thanks
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Notes in the new xl are in fact the original comment from old.

Get the comment from H1

VBA Code:
Sub Button3_Click()
    Dim rng         As Range, s As String
   
    Set rng = Range("H1")
    With rng
        If Not .Comment Is Nothing Then
            s = .Comment.Text
            MsgBox s
        End If
    End With
   
End Sub
 
Upvote 0
This will add a comment if there's not one there, but if one already exists, extract it to the adjacent cell.
Hopefully, this should be enough to demo a solution to both of your questions.
NB Test on a COPY of your work, first!
VBA Code:
Sub cmnt()
Dim cmttxt As String
Dim rng As Range

Set rng = ActiveCell
    If rng.Comment Is Nothing Then rng.AddComment ("New comment added"): Exit Sub
    rng.Offset(0, 1).Value = rng.Comment.Text

End Sub
 
Upvote 0
Pleasure. Hope it's enough for you to implement your own solution.
 
Upvote 0

Forum statistics

Threads
1,214,535
Messages
6,120,090
Members
448,944
Latest member
sharmarick

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top