rediffusion
Board Regular
- Joined
- Apr 24, 2019
- Messages
- 60
Hi all!
Found the script "VBA" which is a little tweaked to fit your needs:
It works great!
But I wanted to add an item to the context Menu. File "PERSONAL.XLSB" in the folder XLSTART\ created scripts are saved and work in all "Excel" documents. But nothing is added to the "Context Menu". For this case used this script:
I get a window with this ERROR:
Unable to execute macro "PERSONAL.XLSB'AddComm" This macro may not be present in the current workbook, or all macros may be disabled.
In General, googled and found this "To add macro from the context menu, you need to keep THIS BOOK".
Got any vacine? I feel uncomfortable if only one document will be added to the item, it is convenient when working in all documents.
P.S.
To cancel there is a script (by the way it works):
UPD:
:=::=::=::=::=::=::=::=::=::=::=::=::=::=::=::
1. If you have created a note the function to return "CTRL+Z" doesn't work (with the usual note is working). How to return to work?
2. If several items (called through RightClickMouseButton) are added to the context menu. How to remove selectively (I repeat that this thing doesn't work in all the docks, only one)? For example:
Special note_1
Special note_2
Special note_3
I want to remove only "Special note_1" how to implement in a macro?
:=::=::=::=::=::=::=::=::=::=::=::=::=::=::=::
Found the script "VBA" which is a little tweaked to fit your needs:
Code:
Sub Special_note()
Dim myComm As Comment
If Not ActiveCell.Comment Is Nothing Then
If MsgBox("The cell already contains a note, delete?", 4) - 7 Then
ActiveCell.Comment.Delete
Else: Exit Sub
End If
End If
Set myComm = ActiveCell.AddComment
With myComm.Shape 'exhibiting the required format
.Height = 110
.Width = 200
.AutoShapeType = 1 'form
.Fill.ForeColor.SchemeColor = 13 'fill
.Line.ForeColor.RGB = RGB(255, 0, 0) 'line color
.DrawingObject.Font.Name = "Consolas" 'font
.DrawingObject.Font.FontStyle = "standard"
.DrawingObject.Font.Size = 9 'font size
End With
'emulate the choice of " Change note"
SendKeys "%": SendKeys "а": SendKeys "и": SendKeys "и": SendKeys "~": SendKeys "{BS}": SendKeys "{BS}"
End Sub
It works great!
But I wanted to add an item to the context Menu. File "PERSONAL.XLSB" in the folder XLSTART\ created scripts are saved and work in all "Excel" documents. But nothing is added to the "Context Menu". For this case used this script:
Code:
Sub SHD_CommAdd()
Dim MyPoint As CommandBarControl
Set MyPoint = Application.CommandBars("Cell").Controls.Add
MyPoint.Caption = "Special note"
MyPoint.OnAction = "PERSONAL.XLSB!AddComm"
MyPoint.Move , 10
End Sub
I get a window with this ERROR:
Unable to execute macro "PERSONAL.XLSB'AddComm" This macro may not be present in the current workbook, or all macros may be disabled.
In General, googled and found this "To add macro from the context menu, you need to keep THIS BOOK".
Got any vacine? I feel uncomfortable if only one document will be added to the item, it is convenient when working in all documents.
P.S.
To cancel there is a script (by the way it works):
Code:
Sub KMRangeClear()
Application.CommandBars("Cell").Reset
End Sub
UPD:
:=::=::=::=::=::=::=::=::=::=::=::=::=::=::=::
1. If you have created a note the function to return "CTRL+Z" doesn't work (with the usual note is working). How to return to work?
2. If several items (called through RightClickMouseButton) are added to the context menu. How to remove selectively (I repeat that this thing doesn't work in all the docks, only one)? For example:
Special note_1
Special note_2
Special note_3
I want to remove only "Special note_1" how to implement in a macro?
:=::=::=::=::=::=::=::=::=::=::=::=::=::=::=::