我想要使用的变量将来自用户并且是公司名称.我需要连接字符串.一个字段名称是"[Amazon Emp Nbr]".
Dim strCompany as String
MsgBox([Amazon Emp Nbr])' This works! I get the value of the field!
StrCompany = "Amazon"
MsgBox("[" & strCompany & " Emp Nbr]")
Run Code Online (Sandbox Code Playgroud)
这不起作用!它返回字符串[Amazon Emp Nbr]而不是字段的值.
使用范围而不是[].在[]不允许使用的变量:
Dim strCompany as String
MsgBox([Amazon Emp Nbr])' This works! I get the value of the field!
StrCompany = "Amazon"
MsgBox Range( strCompany & " Emp Nbr").value
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
26 次 |
| 最近记录: |