在 msgbox excel VBA 中获取文本框值
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20174408/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-12 00:37:18 来源:igfitidea点击:
Geting textbox value in msgbox excel VBA
提问by user3024808
I want a message box to appear after someone has entered a wrong value For example:
我希望在有人输入错误值后出现一个消息框 例如:
Msgbox("The value ""txtID"" is wrong")
So if i typed the wrong value the message box should say "The value 200(for example) is wrong" . How can i do that?
因此,如果我输入了错误的值,消息框应显示“值 200(例如)是错误的”。我怎样才能做到这一点?
回答by Siddharth Rout
Anything within double quotes will be considered as a string. Try this.
双引号内的任何内容都将被视为字符串。尝试这个。
Msgbox("The value " & txtID & " is wrong")