MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

MsgBox and String Question

  Asked By: Lorraine    Date: Nov 29    Category: MS Office    Views: 1581

I am using a userform to prompt a user for some information (in a text
box). I then use a Message Box to display their entries for
confirmation prior to moving to the next action.

Is there a max number of characters you can use in a message box? How
about in a string variable?



3 Answers Found

Answer #1    Answered By: Francis Riley     Answered On: Nov 29

I'm sure there is a maximum size for a string  variable, but I've never hit
it, nor does a quick Google search point me to it. Suffice to say, it is
bigger than you're likely to need, especially if you're storing information
typed in by a user.

Message boxes also. Not sure there's an actual limit, but obviously the
screen size would impose a practical limitation - particularly if you have
line feeds included in the text.

Just do it - I doubt that you'll experience limitations.

Note, however, that there is a very real limit to the amount of text that
can be displayed reliably in a wrapped cell, so keep the individual cells
reasonably short.

Answer #2    Answered By: Alan Palmer     Answered On: Nov 29

Yes, indeed that question  came up recently in the work I'm
doing . . . so far as I know, it's not the limit of the message  box
or userform  which is usually the problem . . . the problem is the
space you might want to put it into, such as a cell or on a page or
on another userform. With my most recent effort, I used a 200
character limit for "comments", but of course that was constrained
by the cell it was being transferred into, limited by the printing
space. I needed to be able to put those comments for 5 call-data
lines onto one page and it worked with that limit.
If you don't have printing limits per page or not those limits,
then you will likely succeed with larger parameters.

Answer #3    Answered By: Guadalupe Rogers     Answered On: Nov 29

To test, I read in a bunch of lines from my spreadsheet and stored
in a string  variable.
Then used msgbox  to display  the variable.
Through trial and error, I found that in Excel 2003,
msgbox only displayed 1024 characters
(actually, I think 1023 and a newline)

Didn't find what you were looking for? Find more on MsgBox and String Question Or get search suggestion and latest updates.