Sub AddCommentPrompt()
Dim strComment As Comment
Dim myText As String
myText = InputBox("Enter Here Comment", "Comments Please")
Set strComment = ActiveCell.Comment
If Not (strComment Is Nothing) Then
ActiveCell.Comment.Delete
End If
Set strComment = ActiveCell.AddComment
If (myText <> "") Then
strComment.Text Text:=myText
End If
With strComment.Shape.TextFrame.Characters.Font
.Name = "Arial"
.Size = 12
.Bold = False
.ColorIndex = 5
End With
End Sub
Dim intCommentWidth As Integer
strComment.Shape.TextFrame.AutoSize = True
With strComment
intCommentWidth = 250
If .Shape.Width > intCommentWidth Then
.Shape.Height = ((.Shape.Width * .Shape.Height) / intCommentWidth) * 1.2
.Shape.Width = intCommentWidth
ActiveCell.Value = strComment.Shape.Height & " - " & strComment.Shape.Width
End If
End With
Sub CommentInsert()
Dim strComment As Comment
Dim myText As String
myText = InputBox("Enter Here Comment", "Comments Please")
Set strComment = ActiveCell.Comment
If Not (strComment Is Nothing) Then
ActiveCell.Comment.Delete
End If
Set strComment = ActiveCell.AddComment
If (myText <> "") Then
strComment.Text Text:=myText
End If
With strComment.Shape.TextFrame.Characters.Font
.Name = "Arial"
.Size = 10
.Bold = False
.ColorIndex = 5
End With
Dim intCommentWidth As Integer
strComment.Shape.TextFrame.AutoSize = True
With strComment
intCommentWidth = 250
If .Shape.Width > intCommentWidth Then
.Shape.Height = ((.Shape.Width * .Shape.Height) / intCommentWidth) * 1.2
.Shape.Width = intCommentWidth
ActiveCell.Value = strComment.Shape.Height & " - " & strComment.Shape.Width
End If
End With
End Sub