Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default InputBox function - prompt string limit

Is there a limit on the size of the string you can pass to the prompt arg of InputBox? For some reason it is not displaying the last line of my menu. MsgBox works fine

Dim Answer2 as Varian
Dim HelpMenu As Strin
HelpMenu = vbCr & "1. Introduction" & vbCr & "2. Summary Pages"
& vbCr & "3. Store Pages" & vbCr & "4. Adding New Products/Stores"
& vbCr & "5. Exit
MsgBox HelpMenu 'this displays as expecte
Answer2 = Application.InputBox(Title:="Menu", prompt:="Enter the number of a "
& "menu item below." & HelpMenu
'this only displays the first 4 lines of HelpMenu. Option 5 doesn't appear, but I can still choose
'it and the code operates correctl

What am I missing here?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default InputBox function - prompt string limit

Marcotte,

I think that what is happening here is that the Inputbox dialog box is a
fixed size, The MsgBox dialog will size to the input, but as inputbox shows
a text input field, it places that in a fixed position, and the dialog box
is fixed around it.

You are not choosing the value 5, you are just inputting the value in the
box. You can just as easily enter 6 which isn't in the list.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Marcotte A" wrote in message
...
Is there a limit on the size of the string you can pass to the prompt arg

of InputBox? For some reason it is not displaying the last line of my menu.
MsgBox works fine.

Dim Answer2 as Variant
Dim HelpMenu As String
HelpMenu = vbCr & "1. Introduction" & vbCr & "2. Summary Pages" _
& vbCr & "3. Store Pages" & vbCr & "4. Adding New Products/Stores"

_
& vbCr & "5. Exit"
MsgBox HelpMenu 'this displays as expected
Answer2 = Application.InputBox(Title:="Menu", prompt:="Enter the number of

a " _
& "menu item below." & HelpMenu)
'this only displays the first 4 lines of HelpMenu. Option 5 doesn't

appear, but I can still choose
'it and the code operates correctly

What am I missing here?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default InputBox function - prompt string limit

Thanks Bob. I kind of figured it was a size/display issue. So there's no way to increase the dimensions of the InputBox

Oh, and I realize I'm just passing a number to the Answer2 variable, and the code would work if I didn't include the HelpMenu string, but entering 6 would be a bad idea because of this snippet of code

Select Case Answer
....
Case 6: system.selfdestruc
....
End Selec
;)
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default InputBox function - prompt string limit

Interesting note: The InputBox METHOD (ie Application.InputBox) is of fixed size; the InputBox FUNCTION seems to grow to fit 'prompt' (at least I got it to display 9 lines, as opposed to 5.)
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default InputBox function - prompt string limit

Hi Marcotte A,
if I am not mistaken, the limit is 1024 characters.
MP
"Marcotte A" a écrit dans le message de
...
Is there a limit on the size of the string you can pass to the prompt arg of

InputBox? For some reason it is not displaying the last line of my menu. MsgBox
works fine.

Dim Answer2 as Variant
Dim HelpMenu As String
HelpMenu = vbCr & "1. Introduction" & vbCr & "2. Summary Pages" _
& vbCr & "3. Store Pages" & vbCr & "4. Adding New Products/Stores" _
& vbCr & "5. Exit"
MsgBox HelpMenu 'this displays as expected
Answer2 = Application.InputBox(Title:="Menu", prompt:="Enter the number of a " _
& "menu item below." & HelpMenu)
'this only displays the first 4 lines of HelpMenu. Option 5 doesn't appear, but

I can still choose
'it and the code operates correctly

What am I missing here?





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Text string sort limit Bob Laverty Excel Discussion (Misc queries) 1 May 27th 09 02:51 AM
Problem with VB string character limit. AJL Excel Worksheet Functions 0 November 3rd 06 07:40 PM
Validation through VBA using string has 255 char limit?????? Allan[_3_] Excel Programming 0 May 6th 04 11:51 PM
Fix InputBox - Returning Empty String spurtniq[_3_] Excel Programming 7 December 31st 03 06:23 PM
String length of Inputbox user input. Hersh Excel Programming 2 July 14th 03 08:47 PM


All times are GMT +1. The time now is 12:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"