VBA中哪个命令可以计算字符串变量中的字符数?
假设我有这个变量:
word =“habit”,
VBA 中的哪个命令将允许我计算这个变量中有多少个字符(在我的例子中是 5)。
重要提示:变量“word”仅包含一个单词,没有空格,但可能包含数字和连字符。
Let's say I have this variable:
word = "habit"
which command in VBA will allow me to count how many characters are there in this variable (in my case it's 5).
Important: the variable "word" contains only one word, no spaces, but may have contain numbers and hyphens.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
你的意思是计算字符串中的字符数吗?这很简单
Do you mean counting the number of characters in a string? That's very simple
虽然这不是你的问题标题所问的=)
Although that's not what your question title asks =)
试试这个:
Try this:
莱恩就是你想要的。
Len is what you want.
使用 Len 函数
Use the Len function