Now want to achieve, when the mouse moves to a cell, no notation automatically add notation effect,
Cell contents as the name, automatically add another excel table the name of the corresponding personnel resume content for the notation, consult everybody masters,
CodePudding user response:
I also want to:As long as I open the programming software, it is "automatically according to my idea to write the program code"!!!!!!!!!!!
You this idea is not correct (perhaps inaccurate descriptions of demand),
Excel worksheets will not trigger a "mouse" message, you really want to "move the mouse,"
It may only in a background thread to get the mouse pointer coordinates, calculate it, on which the cell to do the corresponding processing,
Relative to the idea of "correct", should be to deal with "activity cell"!
But:
1. To automatically add "remark", can't be together, put your cell that are "selected" add remark!!!!
Must have a judgment, which need to be added to the cell, which don't add columns,
2. Your "another table", what kind of data format is it?
"Name" how to "corresponding"?" Where is the content "? With what to "positioning, access to" another table?
These are not clear, do you think who can give you a effective solution!!!!!!
CodePudding user response:
This need not achieve them, is quite complicated, at least,CodePudding user response:
Don't know what kind of effect you want, all cells will display a notation when the mouse point up? Or is not set notation, but the mouse point go up can simulate the effect of the notation,The first kind, because unless forced to display all comments, otherwise will be displayed by the mouse pointing to the cell only remark, so as long as the loop through each cell, each with notation and hidden line, does not need to rely on temporary dynamic code (of course also can temporarily set, redundant, however, unless you need to display the content of the changes in real-time),
Sheet1. Range (" B2 "). The AddComment
Sheet1. Range (" B2 "). The Comment. The Visible=False
Sheet1. Range (" B2 "). The Comment. The Text Text:="asdfasdf"
Second, unable to realize the mouse showed notation MouseOver, only to write code in a SelectionChange event, specific operation is: to create a text box, select different cell with the mouse, and modify it for the text box assignment of Left and Top values, to cling to the right side of the activation cell,
Private Sub Worksheet_SelectionChange (ByVal Target As Range)
With Sheet1. Shapes. Range (Array (" 1 "TextBox))
. TextFrame2. TextRange. Characters. The Text="current cell:" + Target. AddressLocal
. Left=Target. Left + Target. Width
. The Top=Target. The Top
End With
End Sub
CodePudding user response:
custom painting is to learn the skills in the morning and evening,CodePudding user response:
The building Lord, you need to write the mouse Hook requirements, can be realized by VB and VBA not sure,CodePudding user response: