View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Progmatically add code to worksheet_activate

You can have VBA code write VBA code. See
www.cpearson.com/excel/vbe.htm for more details.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Luca" wrote in message
...
Hi,

I have a macro that creates a new worksheet, however when it
does this i
want it to add some code to the worksheet_Activate event of the
new sheet.
Assuming the new worksheet is called "NewYP" and the code i
would like in
activate_Sheet event is

Private Sub Worksheet_Activate()

Toolbars.YPBar

End Sub

How do i go about adding the code ?

All help is appreciated

Luca