Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Sheet Code Module: copying code to

I would like to import a Worksheet_SelectionChange sub into the Sheet
Code Module behind a particular sheet.

I can import it into a separate Class Module, but have been unable to
figure out how to direct it into the Code Module behind the specific
sheet it relates to.

Any suggestions?

There's not a lot of code (23 lines, 143 columns), so I guess I could
string it all together as a CreateEventProc but I couldn't help feeling
I must be missing something going that way

Matthew

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Sheet Code Module: copying code to

Matthew,

You can't import it as a class module, because that class module will
already exist. You will have to build it up as you say.

--

HTH

RP
(remove nothere from the email address if mailing direct)


wrote in message
oups.com...
I would like to import a Worksheet_SelectionChange sub into the Sheet
Code Module behind a particular sheet.

I can import it into a separate Class Module, but have been unable to
figure out how to direct it into the Code Module behind the specific
sheet it relates to.

Any suggestions?

There's not a lot of code (23 lines, 143 columns), so I guess I could
string it all together as a CreateEventProc but I couldn't help feeling
I must be missing something going that way

Matthew



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Sheet Code Module: copying code to

This may not apply, but if you're creating that worksheet, you could use a
template that contains the code.

Kind of:

Dim newwks As Worksheet

Set newwks = Sheets.Add(After:=Sheets(Sheets.Count), _
Type:="C:\WINDOWS\Application Data\Microsoft\Excel\XLSTART\sheet.xlt")

Or maybe just have a hidden worksheet in the workbook that has the code already
there.


" wrote:

I would like to import a Worksheet_SelectionChange sub into the Sheet
Code Module behind a particular sheet.

I can import it into a separate Class Module, but have been unable to
figure out how to direct it into the Code Module behind the specific
sheet it relates to.

Any suggestions?

There's not a lot of code (23 lines, 143 columns), so I guess I could
string it all together as a CreateEventProc but I couldn't help feeling
I must be missing something going that way

Matthew


--

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
copying vba code to a standard code module 1vagrowr Excel Discussion (Misc queries) 2 November 23rd 05 04:00 PM
Sheet code module question Stuart[_5_] Excel Programming 1 August 9th 04 07:14 AM
Reference Addin Module from sheet code zSplash Excel Programming 2 April 19th 04 06:35 PM
Write VBA code into a sheet module using VBA quartz Excel Programming 0 January 20th 04 08:01 PM
Problem copying worksheet containing code module Basie[_2_] Excel Programming 1 September 3rd 03 12:28 AM


All times are GMT +1. The time now is 05:54 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"