简体   繁体   English

不通过加载项将功能添加到Excel

[英]Add function to excel not by add-ins

How I can add a VBA code to be as main function in excel? 如何在Excel中添加VBA code作为主要功能

I need an effective way to add this function to the excel program which allows it to run on multiple locations. 我需要一种有效的方法将此功能添加到excel程序中,从而使其可以在多个位置上运行。

I tried to add it as add-ins, but I faced a problem when I shared it on google drive in an attempt to allow it to be used on other devices. 我尝试将其添加为加载项,但是当我在Google驱动器上共享它以尝试使其在其他设备上使用时遇到了一个问题。

The function name converted to a path "c:/../.." and the cell converted from the correct value to #NAME! 函数名称转换为路径“ c:/../ ..” ,单元格从正确的值转换为#NAME! Error . 错误

Start your code with Function rather than Sub. 使用功能而不是Sub启动代码。 Define inputs/outputs. 定义输入/输出。 Put the code in any .xlsm or .xlsb files you want to access the function from. 将代码放在要从中访问函数的任何.xlsm或.xlsb文件中。

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

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