Handling Worksheet Events of a Worksheet Created During Runtime.

C

chatterbox

Hi Everyone.

I have a small program which creates a worksheet at runtime to display
the results of its analysis in the active workbook. I wish to use
either the worksheet SelectionChange or BeforeRightClick event to
respond to the user interacting with a specific section of the results
worksheet.

If the results worksheet is created at runtime, can anyone tell me how
I should code the user interaction worksheet event ?

If I must create some kind of dynamic worksheet event handler class,
are there examples out there ? Or is the proper solution more obvious
than that ?

Thanks in advance

Chatterbox
 
G

Guest

Why not use the Workbook level version of these events. This will pass in
the sheet where the event occured. Then you can decide, based on the name of
the sheet, whether to perform you action or not.

The alternative is to write the event code to the sheet event after you
create the sheet. I haven't done much serious work in this area, but it
always appeared "fragile" to me (error prone).
http://www.cpearson.com/excel/vbe.htm
for some sample code.
 

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

Top