LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default My own text using right click "New note"

Hi,

I want my own special text (3 lines) inserted in comment box when I right
click "New note"
In Office 2007 I could do that with the vba shown below, but it does not
work in Office 365.
Does someone have a solution that works with Office 365.
I am aware that it is possible to create a complete new button to the right
click menu, but I want to use the existing "New note"

I am running Windows 10 and Office 365

Kind regards,
Kaj Pedersen

This used to work in Office 2007

Insert in Module1
=================

Sub ThisIsMyOwnNote()

Dim cmt As Comment

Set cmt = ActiveCell.Comment

If cmt Is Nothing Then
Set cmt = ActiveCell.AddComment
cmt.Text Text:="This is my own note"
Else
cmt.Text Text:=cmt.Text & Chr(10)
End If
End Sub

----------------------------------------------------------------------------------
Insert in This workbook
=======================

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.CommandBars("Cell").Controls("Insert comment").Reset
End Sub

Private Sub Workbook_Open()
With Application.CommandBars("Cell").Controls("Insert comment")
.OnAction = "Testfile.xlsm" & "!ThisIsMyOwnNote"
End With
End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automating Text to Columns -- can I auto-click "OK" on the message robs3131 Excel Programming 2 July 1st 07 02:04 PM
Can I have "Shift-Click" or "Ctrl-Click" Code on Form List? MikeZz Excel Programming 0 June 13th 07 12:58 AM
"Control" plus "click" doesn't allow me to select multiple cells Ken Cooke New Users to Excel 0 September 25th 06 04:46 PM
I have to double click a cell for the "text" format to take Charles Excel Discussion (Misc queries) 2 January 24th 06 02:46 PM
Worksheets("Brackets").DropDowns("Game10").Click Tony_VBACoder Excel Programming 5 January 28th 05 04:41 AM


All times are GMT +1. The time now is 06:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"