+ Reply to Thread
Results 1 to 5 of 5

Quick "msgbox" question (Visual Basic) / Allow user to respond with text ? [RESOLVED]

  1. #1
    Registered User
    Join Date
    02-08-2004
    Posts
    58

    Quick "msgbox" question (Visual Basic) / Allow user to respond with text ? [RESOLVED]

    [RESOLVED]

    Hey again,


    I have a quick stupid little question about Visual Basic in general (VBA, Macros in Excel), using the MSGBOX function,

    I have searched the 'net and read MSDN msgbox but I cant find what I am looking for. Maybe msgbox is not the correct function to be focusing on ??



    Basically, I want a message box to ask a question, and the answer is dumped into a variable, much like you can do with yes/no/cancel, but (much like a pop-up textbox) I want to be able to respond with text in a textbox.
    [This of course is part of my Excel spreadsheet]

    (I think with C++ it was something like "msgbox = ?$-" or something like that, but I don't know what to look for with VB.)


    Any suggestions ?
    Thanks !

    [RESOLVED]
    Last edited by BaLLZaCH; 05-27-2008 at 07:54 PM. Reason: [RESOLVED]
    Sig ? How can I sign the computer screen ?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello BaLLZaCH,

    You can use the VBA InputBox function to display a message an allow the user to input a string value, or you can also use the Application.InputBox which allows accepts the following types of input based on the Type argument:

    Type argument values
    0 = Formula
    1 = Number
    2 = Text string
    4 = Logical value (True or False)
    8 = Cell reference as a Range object
    16 = Worksheet error value line #N/A
    64 = An array of values

    See the VBA help files for more on these functions and their arguments.

    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    02-08-2004
    Posts
    58

    Thumbs up

    [RESOLVED]


    Beautiful.


    Thank you very much, Leith.




    [RESOLVED]

  4. #4
    Forum Contributor
    Join Date
    04-21-2007
    Location
    Lima, Peru
    MS-Off Ver
    2000, 2007, 2010
    Posts
    674

    User input

    HI

    From what you say there are a coupel of ways that you could go, first using an INPUT Box.

    Please Login or Register  to view this content.
    If you want to restrict tha data to be entered then you would be better off with a USERFORM and using a listbox or similar to present the choices. An example is attached.

    Regards


    Jeff
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-08-2004
    Posts
    58
    [RESOLVED FOR NOW]

    Thank you for the example Jeff, I was actually wondering exactly what you suggested about 'restricing data via the listbox' ....



    I do not have time to look at it right now, but I will study your example in the next few days, and I really do appreciate the help...


    Thank you 'Jeff', and thank you again 'Leith Ross'


    Thanks,
    Zach

    [RESOLVED FOR NOW]
    Last edited by BaLLZaCH; 05-27-2008 at 10:07 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1