Share via

How to copy a sheet including VBA script function to another excel

Anonymous
2018-01-03T12:12:35+00:00

How to copy  a sheet including VBA script function to another excel

I create excel sheet template for doing something .

I  write a custom function and  apply it to excel sheet  as below.

 After that I copy this sheet to another excel file. I found that the custom function is missing.

#Name?

How should I do for the issue.

Thank you for your help.

Pongthorn

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Vijay A. Verma 104.9K Reputation points Volunteer Moderator
    2018-01-03T12:46:01+00:00

    Put your code in Personal.xlsb to solve this issue. In this case, your function would be available to you in all Excel workbooks on your computer. (But it won't be available to anybody else. If this needs to be available to everybody else, then you will need to copy code in that Excel workbook itself).

    Please refer to following article and go to the section "Making Your Custom Functions Available Anywhere"

    https://support.office.com/en-in/article/Create...

    Was this answer helpful?

    0 comments No comments
  2. DaveM121 891K Reputation points Independent Advisor
    2018-01-03T12:28:47+00:00

    Hi Pongthorn, you will have to copy the sheet data and the VBA individually, the VBA does not automatically copy over when you copy the sheet data . . .

    Copy the sheet data across to the other workbook

    Then copy the VBA over to the VBA Editor (Press Alt + F11) on the new sheet

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2018-01-03T12:27:31+00:00

    Ciao,

    you can create an Excel Template with macros (.xltm) and reuse it as needed.

    Hope this helps you somehow.

    Ciao

    Ugo

    Was this answer helpful?

    0 comments No comments