对多个工作簿使用Excel VBA变量 [英] Using Excel VBA variable for multiple workbooks

查看:263
本文介绍了对多个工作簿使用Excel VBA变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在多个工作簿中的Excel VBA中使用一个变量?不使用加载项方法?如此处所述.

Is it possible to use one variable in Excel VBA across multiple workbooks? Without using Add-in approach? as mentioned in here.

例如,我将Windows用户名保存在var sysUser中,并想在多个工作簿中使用此变量,我该怎么做?

For e.g I am saving Windows User name in var sysUser and want to use this variable in multiple workbooks, how can I do that?

感谢和问候

艾哈迈德

推荐答案

http://www .cpearson.com/excel/trulyglobalvariables.htm

此链接包含两个很好的解决方案.务必 深入了解隐藏名称"技术的链接,该链接简短而有趣.

This link contains two great solutions to this problem. Be sure to drill down to the "hidden name" technique's link which is short and sweet.

这是芯片隐藏名称解决方案的症结所在

Here's the crux of chip's hidden name solution

Application.executexcel4mAcro("SET.NAME(""test",1)")

Application.executexcel4mAcro("SET.NAME(""test"",1)")

有关详细信息,请参见链接

See the link for full details

这篇关于对多个工作簿使用Excel VBA变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆