Dynamically insert macro into a new excel workbook

后端 未结 1 1750
天命终不由人
天命终不由人 2020-12-11 03:11

How can an existing macro be inserted into a new excel workbook?

I want to create a new WorkBook (with vba), and then place an existing macro into the n

相关标签:
1条回答
  • 2020-12-11 03:37

    The two options that JMax mentioned:

    "hard way"

    • Pearson's Copy a module from one project to another

    "easy way"

    • Use your existing workbook with the UserForm as a template to create the new WorkBook
      1. Save the existing workbook as is (to preserve your current file)
      2. Strip out any unwanted sheets
      3. If you need to strip out any code then you are effectively back to the first option as you will need Pearson's Deleting A Module From A Project / Deleting A Procedure From A Module
      4. Save as a new file

    We would need to see a sample of your workbook to provide further detailed help.

    0 讨论(0)
提交回复
热议问题