View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default adding text to comment

Change

Comment.Visible = True
Comment.Shape.Select


to

Target.Comment.Visible = True
Target.Comment.Shape.Select


If this post helps click Yes
---------------
Jacob Skaria


"Jock" wrote:

Hi,
The following code will add a comment to a cell in column "AW" when it is
double clicked.
The user will need to add text to the comment so I put in the final two
lines of code hoping to make the comment appear on screen ready to be edited
but that doesn't happen.
What do I need to add/change for this to happen?

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Excel.Range, Cancel
As Boolean)
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("AW:AW")) Is Nothing Then
ActiveCell = "P"
'Application.EnableEvents = False
Target.AddComment " passed by " & UserName() & " on " & Format(Date,
"dd/mmm")
Target.Comment.Shape.TextFrame.AutoSize = True
End If
Comment.Visible = True
Comment.Shape.Select

ws_exit:
Application.EnableEvents = True
End Sub
--
Traa Dy Liooar

Jock