Search code examples
excelvbalimitcharacterinputbox

Overcome VBA InputBox Character Limit


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?


Solution

  • 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...