vba - VBA 使用字符串作为范围
问题描述
我的 VBA 工具需要帮助。
在我的程序中,我定义了一个字符串关键字:
Public Sub SetKeyword()
Call Define_Variables.variables
Call Database.Allocation
strKeyword="KINDACC"
现在我想用我的字符串关键字设置范围关键字的名称,所以它看起来像这样:
Public Sub SetKeyword()
Call Define_Variables.variables
Call Database.Allocation
strKeyword="KINDACC"
rngKeyword= r_KINDACC
End Sub
在我的模块“数据库”中,我已经定义了那些 r_strKeywords:
Sub Allocation()
'General accident information
...
Set r_KINDACC = Worksheets("Database").Range("N4:N14")
End sub
所以稍后我想用我的 GUI 定义一个字符串关键字,我的程序会自动用我的字符串关键字定义我的范围关键字:
Public Sub SetKeyword()
Call Define_Variables.variables
Call Database.Allocation
strKeyword=blabla
rngKeyword= r_strKeyword
End Sub
那可能吗?我希望它不会太混乱
谢谢!!
维多利亚
解决方案
推荐阅读
- javascript - 我如何“重新启动”jQuery(window).resize(checkSize)?
- android - 如何保存图像分类模型并将其用于 android
- npm - `yarn remove` 一个 deps 列表,而不会因错误而放弃
- excel - 将单元格样式从一种样式更改为另一种样式
- airflow - 自定义气流操作符作为“插件”或从 dags 目录直接导入
- c++ - 在树中,我得到错误,没有匹配函数调用函数,但我使用模板正确地完成了它
- java - 无法为 DDL 执行 docker 打开 JDBC 连接
- tensorflow - 尝试使用 Anaconda 的 pip 安装 TensorFlow 时出错
- excel - 是否可以将日期组合在一起并返回该组的开始和结束日期?
- css - 使用内联 CSS 的 GMail 电子邮件中的水印 - 不能使用 STYLE 标记 - 在电子邮件正文的中心覆盖透明图像