Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Insert code into each worksheet's "Sub Worksheet_SelectionChange" Function

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default Insert code into each worksheet's "Sub Worksheet_SelectionChange" Function

John,

Try this site:
http://www.cpearson.com/excel/codemods.htm

--
sb
"John" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Insert code into each worksheet's "Sub Worksheet_SelectionChange"Function

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

John wrote:

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


--

Dave Peterson

Reply
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
"Find" function question - No code required N1KO Excel Discussion (Misc queries) 1 May 6th 09 03:59 PM
Lost "File Menu" - now it's "Edit / View / Insert.." but no "F daves Excel Discussion (Misc queries) 3 April 24th 07 04:52 AM
Change the "Insert Function" display for mail merge Beach Lover Excel Worksheet Functions 3 November 1st 06 06:41 PM
SUM Calculations Returns #VALUE but displays correct total with "Insert Function"=fx Yo! Excel Worksheet Functions 2 September 7th 06 08:22 PM
Insert "-" in text "1234567890" to have a output like this"123-456-7890" Alwyn Excel Discussion (Misc queries) 3 October 25th 05 11:36 PM


All times are GMT +1. The time now is 12:29 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"