Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
copying vba code to a standard code module | Excel Discussion (Misc queries) | |||
Sheet code module question | Excel Programming | |||
Reference Addin Module from sheet code | Excel Programming | |||
Write VBA code into a sheet module using VBA | Excel Programming | |||
Problem copying worksheet containing code module | Excel Programming |