Hi, I have this code, that is working fine, but I have a couple of improvements in mind. What I want to do is have the ability in this code to not only insert a cell comment but to edit the cell comment once it is inserted. Also, I have tested this on a mac and it works fine, but on a pc the comment frame does not autosize. Any ideas why?
Code:
Sub AddNewCom()
Dim strCommentName As String
Dim cmnt As String
Dim Today
Today = Now
cmnt = InputBox("Please enter a comment")
strCommentName = "Greer: " & cmnt & " : " & Now
On Error GoTo 0
If Not activeCell.Comment Is Nothing Then GoTo 0
With activeCell.AddComment(strCommentName)
.Visible = False
.Shape.AutoShapeType = msoShapeRoundedRectangle
With .Shape.TextFrame
With .Characters(0, Len("Greer:")).Font
.Bold = True
.Italic = True
.ColorIndex = 3
End With
End With
End With
With activeCell
.Comment.Shape.TextFrame.AutoSize = True
.Comment.Visible = False
End With
Exit Sub
0:
If Err.Number <> 0 Then MsgBox Err.Description
End Sub