Consulting

Results 1 to 5 of 5

Thread: Solved: MsgBox "Prompt Message"

  1. #1
    VBAX Mentor jammer6_9's Avatar
    Joined
    Apr 2007
    Location
    Saudi Arabia
    Posts
    318
    Location

    Solved: MsgBox "Prompt Message"

    Is it possible to take the msgbox "Prompt Message" to be the value of a textbox in a Userform?
    T-ogether
    E-veryone
    A-chieves
    M-ore


    One who asks a question is a fool for five minutes; one who does not ask a question remains a fool forever.

  2. #2
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    It seems like coding you don't need to do as you already have to pass the variable to the msgbox so why not pass it directly to the textbox? but you could do something like:
    [VBA]
    Dim MBox as String
    MBox = "Prompt Message"
    msgbox "MBox"
    Textbox1.Value=MBox
    [/VBA]
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  3. #3
    VBAX Mentor jammer6_9's Avatar
    Joined
    Apr 2007
    Location
    Saudi Arabia
    Posts
    318
    Location
    Simon Says:




    Quote Originally Posted by Simon Lloyd
    It seems like coding you don't need to do as you already have to pass the variable to the msgbox so why not pass it directly to the textbox? but you could do something like:
    [vba]
    Dim MBox as String
    MBox = "Prompt Message"
    msgbox "MBox"
    Textbox1.Value=MBox
    [/vba]
    T-ogether
    E-veryone
    A-chieves
    M-ore


    One who asks a question is a fool for five minutes; one who does not ask a question remains a fool forever.

  4. #4
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Should it not be msgbox MBox (quotes removed) ?
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  5. #5
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    Lol! Malcom thanks! thats what you get for not paying attention to what you are writing!, but there again jammer should have noticed my faux pas when he ran the code!
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

Posting Permissions

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