简体   繁体   English

自动将宏添加到一组Excel文件的最简单方法是什么

[英]What is the easiest way to add Macro automatically to a set of Excel Files

I have a macro function that I have added to an excel file. 我有一个已添加到Excel文件中的宏函数。 My question is how can I add the same macro function to a specific set of excel files without copy pasting the macro in each excel vba editor.What is the easiest way to achieve this? 我的问题是如何在不将复制宏粘贴到每个excel vba编辑器中的情况下将相同的宏函数添加到一组特定的excel文件中?最简单的方法是什么?

The objective is for the users who have no knowledge on excel macros should be able to easily add Macros to excel and execute it. 目标是对于不了解excel宏的用户应该能够轻松地将Macros添加到excel并执行它。

If the people who are importing the macros are also the users of these macros you might want to create an add-in out of your vba macro. 如果要导入宏的人员同时也是这些宏的用户,则您可能希望从vba宏中创建外接程序。 The procedure is described here . 该过程在此处描述。 The users would just have to install the add-in on their PCs once( step 4 ). 用户只需要在自己的PC上安装一次外接程序( 步骤4 )。 They can then use the add-in for several Excel-files. 然后,他们可以将加载项用于多个Excel文件。

This needs to be done by each user once: 每个用户需要执行一次此操作:

Step 4: Install the Add-In: 步骤4:安装加载项:

Go to Tools > Add-Ins to open the Add-Ins dialog. 转到工具>加载项以打开“加载项”对话框。 If you have stored your Add-In in the default location you will see its name displayed in the Add-Ins available: window (if you have stored your Add-In in a different folder, use the [Browse] button to find it). 如果您将外接程序存储在默认位置,则会在可用的外接程序:窗口中看到其名称(如果您将外接程序存储在其他文件夹中,请使用[浏览]按钮进行查找) 。 Click on your Add-In's name to see its description at the bottom of the dialog box. 单击您的加载项的名称,以在对话框底部查看其说明。

To install your Add-In place a tick in the check-box next to your Add-In's name and click [OK]. 要安装外接程序,请在外接程序名称旁边的复选框中打勾,然后单击[确定]。 [Click the thumbnail below to see a full-sized image]... [单击下面的缩略图以查看完整尺寸的图像] ...

Installing your Add-In (Excel 2002) Installing your Add-In (Excel 2000/97) 安装外接程序(Excel 2002)安装外接程序(Excel 2000/97)

As soon as the Add-In is installed its functions will be available in Excel. 加载项安装完成后,其功能将在Excel中可用。 Find them in the User Defined section of the Function Wizard (Paste Function Tool) or simply type them into a cell as you would any built-in function. 在功能向导(粘贴功能工具)的“用户定义”部分中找到它们,或者像在任何内置函数中一样将它们键入到单元格中。 The Add-In will remain installed until you return to the Add-Ins dialog and uninstall it by removing the tick from the check-box. 加载项将保持安装状态,直到您返回到“加载项”对话框并通过从复选框中删除勾号将其卸载。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM