Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi...
I'm trying to create a macro button that will insert and/or delete a comment within the active cell without any access to the menu toolbars. Also, how can i disable the right click in a workbook? Thanks if anyone can help me. Jack |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Jack,
For comments : Sub AddOrDeleteComment() Dim cmt As Comment If ActiveCell.Comment Is Nothing Then ActiveCell.AddComment "This is a new comment" Else ActiveCell.Comment.Delete End If End Sub For disabling right-click : Application.CommandBars("Cell").Enabled = False Amit "Jack" wrote in message ... Hi... I'm trying to create a macro button that will insert and/or delete a comment within the active cell without any access to the menu toolbars. Also, how can i disable the right click in a workbook? Thanks if anyone can help me. Jack |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Amit Shanker wrote:
For comments : Sub AddOrDeleteComment() Dim cmt As Comment If ActiveCell.Comment Is Nothing Then ActiveCell.AddComment "This is a new comment" Else ActiveCell.Comment.Delete End If End Sub Hi, do you need the "Dim cmt as Comment"? Because I can't see where it's used. As for the Right Click, you can set Cancel to True in the BeforeRightClickEvent of the Workbook. Regards, -- Beto Reply: Erase between the dot (inclusive) and the @. Responder: Borra la frase obvia y el punto previo. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You are right, it's not needed. I was trying code in a different way before
posting and it simply got left there !! Amit "Beto" wrote in message ... Amit Shanker wrote: For comments : Sub AddOrDeleteComment() Dim cmt As Comment If ActiveCell.Comment Is Nothing Then ActiveCell.AddComment "This is a new comment" Else ActiveCell.Comment.Delete End If End Sub Hi, do you need the "Dim cmt as Comment"? Because I can't see where it's used. As for the Right Click, you can set Cancel to True in the BeforeRightClickEvent of the Workbook. Regards, -- Beto Reply: Erase between the dot (inclusive) and the @. Responder: Borra la frase obvia y el punto previo. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi...
Thanks for your help. I noticed that the code you wrote puts a comment into the active cell but doesn't allow it to be edited. What would be good is for a comment box to be pop up awaiting input. Thanks in advance... Gordon... -----Original Message----- Hi Jack, For comments : Sub AddOrDeleteComment() Dim cmt As Comment If ActiveCell.Comment Is Nothing Then ActiveCell.AddComment "This is a new comment" Else ActiveCell.Comment.Delete End If End Sub For disabling right-click : Application.CommandBars("Cell").Enabled = False Amit "Jack" wrote in message ... Hi... I'm trying to create a macro button that will insert and/or delete a comment within the active cell without any access to the menu toolbars. Also, how can i disable the right click in a workbook? Thanks if anyone can help me. Jack . |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There are some code samples he
Insert a Plain Comment http://www.contextures.com/xlcomments03.html#Plain Jack wrote: Thanks for your help. I noticed that the code you wrote puts a comment into the active cell but doesn't allow it to be edited. What would be good is for a comment box to be pop up awaiting input. -----Original Message----- Sub AddOrDeleteComment() Dim cmt As Comment If ActiveCell.Comment Is Nothing Then ActiveCell.AddComment "This is a new comment" Else ActiveCell.Comment.Delete End If End Sub For disabling right-click : Application.CommandBars("Cell").Enabled = False Amit "Jack" wrote in message ... Hi... I'm trying to create a macro button that will insert and/or delete a comment within the active cell without any access to the menu toolbars. Also, how can i disable the right click in a workbook? -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Debra. I checked out your code for comments and am wondering what 'SendKeys "%ie~" does?
Robbyn |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Used with the SendKeys statement, % represents the Alt key, and ~
represents the Enter key. When a cell that contains a comment is selected, it's like pressing Alt+I (to open the Insert menu), then E (to highlight Edit Comment), then pressing the Enter key to activate the command. Robbyn wrote: Hi Debra. I checked out your code for comments and am wondering what 'SendKeys "%ie~" does? Robbyn -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sendkeys "types" those characters
Select a cell with a comment in it. hit alt-i (insert from the worksheet menubar) (alt is represented by %) e (accellerator key for Edit Comment (notice the underline) ~ (sends an enter key) Robbyn wrote: Hi Debra. I checked out your code for comments and am wondering what 'SendKeys "%ie~" does? Robbyn -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Comment box | Excel Worksheet Functions | |||
copy comment content to cell content as data not as comment | Excel Discussion (Misc queries) | |||
How can I edit a comment w/o first having to select Show Comment | Excel Discussion (Misc queries) | |||
How do I insert a comment when the Insert:Comment menu is greyed? | Excel Discussion (Misc queries) | |||
a comment plugin & copy paste directly from excel to comment ? fr. | Excel Worksheet Functions |