Copy Workbook event codes into new workbook

  • Hi


    I am using cpearsons code to copy modules from one workbook to another workbook. But I am unsucessful to copy codes associated with workbook_open event or workbook_beforesave event. Can anyone help me out in this.


    Following code from
    http://www.cpearson.com/excel/vbe.htm
    is being used


    The following procedure will copy Module1 from Book2 to Book1.





    I want to copy codes associated with workbook events from Book2 to Book1. Can anyone please help me in this?




    Thanks




    Ram P

  • Try the following that will copy all of the code in the ThisWorkbook module of the workbook containing the code to the active workbook. Modify as needed for your case. The check in the first part of the code may not be needed if you are confident the necessary permissions exist.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!