Insert code into each worksheet's "Sub Worksheet_SelectionChange" Function

  • Thread starter Thread starter John
  • Start date Start date
J

John

Is there a way to have a module insert a piece of code
into the each worksheets "WorkSheet_SelectionChange"
function. The worksheets are newly created so that is why
I have to insert the code from a module.

Thanks,
John
 
If it's all the same code, maybe you could use:
Workbook_SheetSelectionChange

It's under the ThisWorkbook module.

Private Sub Workbook_SheetSelectionChange _
(ByVal Sh As Object, ByVal Target As Range)

When you're testing, add a line (just to see how it passes important info):

msgbox sh.name & vblf & target.address
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top