Input Box takes only Strings up to 256 characters

LuBuExc

New Member
Joined
Aug 8, 2019
Messages
4
Hi, I try to fill a few cells with text in an Excel Form. Some of the text has up to 1000 characters, and the origin is on a website or a Word_document. I copy the text by CTRL+C and then use the inputbox in a VBA macro to fill the Excel-form, line by line. All works fine, but the InputBox does not accept String/Text of a length of over 256.
Even using Dim Input_X as String * 1000, does not help. It is the InputBox mask which seems not to take a strings over 256 characters when I use CTRL+V. The little input window in the InputBox simply stays empty until the length of my string is smaller than 256.
Yes, I could use 'Cells (i,10).select' (if this is my actual target cell), followed by ActiveSheet.Paste but then I need to use MsgBox before and after to stop the Macro, to allow me to know when I can use my CTRL-C and to see at which variable input I am.
The solution via inputBox is much more suitable, but restricts the text I wonna use. Can anybody help? Thanks in advance.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
How about using a textbox on a userform instead of an inputbox?
 
Upvote 0
Solution
How about using a textbox on a userform instead of an inputbox?
Hi Fluff, thanks a lot. This does the trick. Whereas the InputBox allows only to enter text (a string) of length < 256, the textbox has no (?) restrictions. At least 1000 characters (probably more) are no issue, and I don't need to Dim the variables as clicking a "Submit-Button" writes the contents of my 6 textboxes on the UserForm directly into the destination cells. One line in the macro calling this userform brings me directly into the "first not filled in row". Thanks a lot!!!
 

Attachments

  • Ashampoo_Snap_07 April 2021_12h35m55s_003_.png
    Ashampoo_Snap_07 April 2021_12h35m55s_003_.png
    48.9 KB · Views: 16
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,213,538
Messages
6,114,220
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top