I have a workbook containing several sheets, all of which have the same Worksheet_SelectionChange event. (The events only run when certain columns and rows are selected.)
I want this event to also apply on new sheets added by the user by pressing a button. This sheet adding macro, as well as pasting formats from an existing sheet will also paste the sheet's code.
I think the way this could be done would be by pasting VBproject.VBComponents.... into a text file and re-importing into the new sheet module's code. However I could do with some more help.
My next question is, can this still work if I have password protected my VBA project?
(I guess a work around could be unhiding existing hidden sheet that already have the code but I would like to know the proper way to do this.)
Thanks very much
Dr B
I want this event to also apply on new sheets added by the user by pressing a button. This sheet adding macro, as well as pasting formats from an existing sheet will also paste the sheet's code.
I think the way this could be done would be by pasting VBproject.VBComponents.... into a text file and re-importing into the new sheet module's code. However I could do with some more help.
My next question is, can this still work if I have password protected my VBA project?
(I guess a work around could be unhiding existing hidden sheet that already have the code but I would like to know the proper way to do this.)
Thanks very much
Dr B