Home > Software engineering >  A question about selectchanged
A question about selectchanged

Time:09-17

Excuse me: I made a model form, there is a text box, and I hope that in any worksheet cell per click the mouse, automatically in the text box displays the name of the table and cell address, I'll use selectchanged event is processed, but to add event handlers in each table, and I hope that the form can response selectchanged events, wonder if I can do it?

CodePudding user response:

I think from the "events" itself, it is not possible,

Because of this "event" of object is the WorkSheet, how is it possible to inform UserForm!
You this requirement, or in each worksheet to write honestly event code (if just show "activity cell content", also just so 1 word),
Or use the Timer event "" scan regularly, have found that the current activity worksheet/cell changes, just update the TextBox display content,

CodePudding user response:

Can do ah, don't write in each sheet, is not a "TisWorkbook", in there, there is sheetSelectionChange events can use the

 
Private Sub Workbook_SheetSelectionChange (ByVal Sh As Object, ByVal Target As Range)
The Debug. Print Target. The Worksheet. CodeName & amp; ":" & amp; Target. Row & amp; ", "& amp; Target. The Column & amp;
")"End Sub


CodePudding user response:

Oh, you want to form, the code change, directly throwing a userform. Textbox1 and so on

CodePudding user response:

reference 3 floor crispy large ice cream response:
oh, you want to form, the code change, such as direct throw a userform. Textbox1 line


Dizzy, fooled by the name of the event...
I have always thought it was in "the selected worksheet" changes trigger events,
  •  Tags:  
  • VBA
  • Related