本文介绍了克服VBA InputBox字符限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我用来收集文本的当前函数InputBox显然不能接受超过255个字符,我需要能够收集更多吗?是否有参数或不同的函数我可以用来增加这个限制?
The current function I use to collect text InputBox can't accept more than 255 characters apparently, and I need to be able to collect more than that? Is there a parameter or different function I can use to increase this limit?
推荐答案
Inputbox会让你输入最多255个字符,但它只会返回254个字符。
To be pedantic, the Inputbox will let you type up to 255 characters, but it will only return 254 characters.
除此之外,您需要创建一个带有文本框的简单表单。然后只是做一个小的帮助函数类似:
Beyond that, yes, you'll need to create a simple form with a textbox. Then just make a little "helper function" something like:
Function getBigInput(prompt As String) As String
frmBigInputBox.Caption = prompt
frmBigInputBox.Show
getBigInput = frmBigInputBox.txtStuff.Text
End Function
或类似的东西...
这篇关于克服VBA InputBox字符限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!