+ Reply to Thread
Results 1 to 10 of 10

Populating a multiline textbox with a range

  1. #1
    Registered User
    Join Date
    08-04-2013
    Location
    Brisbane
    MS-Off Ver
    Excel for Mac 2021
    Posts
    97

    Populating a multiline textbox with a range

    Please help me!

    I have been struggling (again) with this problem for hours and I can't seem to solve it. I have searched the forums and I have strung some things together but nothing is doing exactly what I need.

    I need to populate a multiline textbox with range B3:B32.

    Here is what I have so far:
    Please Login or Register  to view this content.
    Currently, I am getting either a "type mismatch" or a runtime error.

    I would greatly appreciate any help you could offer.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: Populating a multiline textbox with a range

    Is TbClist the textbox?

    If it is remove Controls, and you might want to do a little concatenation.
    Please Login or Register  to view this content.
    You could also try this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    08-04-2013
    Location
    Brisbane
    MS-Off Ver
    Excel for Mac 2021
    Posts
    97

    Re: Populating a multiline textbox with a range

    Hi Norie. Thank you! I have read many of your posts.

    Yes, TbCList is the textbox name.

    I'll give this a go and get back to you

  4. #4
    Registered User
    Join Date
    08-04-2013
    Location
    Brisbane
    MS-Off Ver
    Excel for Mac 2021
    Posts
    97

    Re: Populating a multiline textbox with a range

    Both work thanks, Norie.

    Would there be a way to use this with
    HTML Code: 
    so as to not copy blank cells/lines into the textbox?

    I have tried this:
    Please Login or Register  to view this content.
    to no avail.
    Thanks again!

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: Populating a multiline textbox with a range

    Perhaps.
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    08-04-2013
    Location
    Brisbane
    MS-Off Ver
    Excel for Mac 2021
    Posts
    97

    Re: Populating a multiline textbox with a range

    You, my friend, are a genius! This is a huge help.

    The textbox had to populate without any blank rows as the textbox saves this list back to the same range.

    Thank you so much for your time. It is greatly appreciated.

  7. #7
    Registered User
    Join Date
    08-04-2013
    Location
    Brisbane
    MS-Off Ver
    Excel for Mac 2021
    Posts
    97

    Re: Populating a multiline textbox with a range

    Sorry to bother you again

    There is an error when there is only one name in the list on the line:
    Please Login or Register  to view this content.
    No doubt this is because there is no array.
    I'm trying to use an if statement to trap this error but I can't seem to introduce it.

    UPDATED:
    Also, when there is nothing in the range B3:B32, the textbox shows the value of cell B2? That must be the xlup as B2 has text in it. However, the array should start from B3 (see your post). As always, there is no quick fix
    I have fixed this by preceding this with an "If ... Then Exit Sub" statement Now it's just the array issue.

    Any ideas, Norie?
    Last edited by Sc0ut; 01-20-2015 at 07:43 AM.

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: Populating a multiline textbox with a range

    Perhaps.
    Please Login or Register  to view this content.
    PS Have you considered using a ListBox instead of a multiline TextBox?

  9. #9
    Registered User
    Join Date
    08-04-2013
    Location
    Brisbane
    MS-Off Ver
    Excel for Mac 2021
    Posts
    97

    Re: Populating a multiline textbox with a range

    Thanks, Norie. I'll give this a go.

    Unfortunately I can't use a ListBox as I need to be able to paste in a list of names into the TextBox. This list then populates the range B3:B32 on the sheet.

    I'll get back to you shortly. Many thanks, Norie! You're a champion!

  10. #10
    Registered User
    Join Date
    08-04-2013
    Location
    Brisbane
    MS-Off Ver
    Excel for Mac 2021
    Posts
    97

    Re: Populating a multiline textbox with a range

    That worked perfectly! That's that fixed. Thanks again for your help, Norie.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Populating text to a textbox from a listbox multiline in sequence.
    By molesy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-15-2014, 03:37 AM
  2. Populating userform listbox from sheet cell with multiline text
    By newbi004 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-16-2013, 07:44 AM
  3. [SOLVED] TextBox Multiline: have <br> tag between lines
    By monak83 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 04-20-2012, 11:26 AM
  4. Help with populating textbox with info from a range of cells
    By Rob* in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-28-2011, 09:44 AM
  5. TextBox MultiLine and WordWrap
    By BillWilts in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-15-2010, 12:52 PM

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