+ Reply to Thread
Results 1 to 4 of 4

Msg box to fill listbox in form?

  1. #1
    Registered User
    Join Date
    04-01-2011
    Location
    North Carolina
    MS-Off Ver
    Excel 2007
    Posts
    23

    Msg box to fill listbox in form?

    Well i have a sub that outputs a long message box. What I want to do is add whats in the msgbox into a listbox in a vba form?

    Here is the message box i need to transfer.
    Thanks for any help

    Please Login or Register  to view this content.
    Last edited by danielgri14; 04-27-2011 at 07:56 PM.

  2. #2
    Registered User
    Join Date
    04-27-2011
    Location
    Idaho, US
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Msg box to fill listbox in form?

    So you just want this displayed in a userform?
    Do you want the variables count1,2,3... and sumLB1,2,3... pushed into the form?
    How would it look, something like the attached?
    Attached Images Attached Images

  3. #3
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Msg box to fill listbox in form?

    danielgri14,

    What I think you want is a textbox or label instead of a listbox. A listbox can only hold a list of data and is usually populated via the RowSource property.

    To put the msgbox contents into a textbox, you would set the textbox.text property = the msgbox contents (instead of using the messagebox). For a label it would use the label.caption property.

    Example:
    -Add a textbox or label to the userform
    -The sample code assumes the textbox is named TextBox1 or the label is named Label1

    Please Login or Register  to view this content.


    Hope that helps,
    ~tigeravatar

  4. #4
    Registered User
    Join Date
    04-01-2011
    Location
    North Carolina
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Msg box to fill listbox in form?

    Ok got it, i just had to set the txtbox to multiline

+ 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