Consulting

Results 1 to 3 of 3

Thread: adding code to a sheet that is added at runtime

  1. #1

    Question adding code to a sheet that is added at runtime

    if i have a sheet that uses the selection change event to do x (call say, module6.exa) and i programmatically add a sheet in the future and want that same code module to apply to the new sheet also, is there a way to do so?
    thx, cheers
    erik

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Personally, if I were faced with that I would create a hidden template sheet and just copy it.....
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    ThisWorkbook has a Worksheet_SelectionChange event that would apply to newly added sheets.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •