Sheet Code Module: copying code to

  • Thread starter Thread starter matthewgdodds
  • Start date Start date
M

matthewgdodds

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
 
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)
 
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.
 

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