Overcome VBA InputBox Character Limit

Ryan B picture Ryan B · Jun 3, 2010 · Viewed 12.6k times · Source

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?

Answer

BradC picture BradC · Jun 3, 2010

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

or something like that...