+ Reply to Thread
Results 1 to 7 of 7

Adding TextBox Value Next to Existing Item in ListBox

  1. #1
    Registered User
    Join Date
    08-31-2014
    Location
    Edmonton, Alberta, Canada
    MS-Off Ver
    2010
    Posts
    27

    Adding TextBox Value Next to Existing Item in ListBox

    Hey all.

    I am probably going about this the completely wrong way, but I set a form up in a specific manner, and now I am trying to figure out a way to make this work. I will try to explain the process as clearly as I can. Maybe it won't seem so complicated once I type it out.

    I have a UserForm that contains a ListBox (ListBox1). Here is the code for this box:

    Please Login or Register  to view this content.
    I have a TextBox (TextBox1) that shows a date.

    Is there a way to have the text in TextBox1 appear next to select items in the ListBox. I realize that the code I am about to show you doesn't work, but perhaps it will illustrate my point:

    Please Login or Register  to view this content.
    Any suggestions/ solutions would be greatly appreciated.

    Thanks!

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Adding TextBox Value Next to Existing Item in ListBox

    The code appears to work for me. I invoked it as follows

    Please Login or Register  to view this content.
    Please see the attachment
    Attached Files Attached Files
    Martin

  3. #3
    Registered User
    Join Date
    08-31-2014
    Location
    Edmonton, Alberta, Canada
    MS-Off Ver
    2010
    Posts
    27

    Re: Adding TextBox Value Next to Existing Item in ListBox

    I forgot to mention that the TextBox starts blank and that it will change based on user input.

    The location of the ListBox is within a tab. Should I place the code under the Sub for a tab change so that it refreshes?

    Is there something special that needs to be done to make that happen?

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,365

    Re: Adding TextBox Value Next to Existing Item in ListBox

    It woudl be easier to help if you provided a sample workbook.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    08-31-2014
    Location
    Edmonton, Alberta, Canada
    MS-Off Ver
    2010
    Posts
    27

    Re: Adding TextBox Value Next to Existing Item in ListBox

    Quote Originally Posted by AliGW View Post
    It woudl be easier to help if you provided a sample workbook.
    It is exactly what mrice had created except the textbox starts blank.

    I have gotten the code to work when I populate the ListBox after the date has been entered, but I want to be able to replace the ListBox's contents should there be a change to this date.

  6. #6
    Registered User
    Join Date
    08-31-2014
    Location
    Edmonton, Alberta, Canada
    MS-Off Ver
    2010
    Posts
    27

    Re: Adding TextBox Value Next to Existing Item in ListBox

    Alright. So I found a working solution.

    I have added the code so that any time there is a change in page it will clear the listbox and repopulate it based on the new information.

    This keeps it up to date every time a user switches screens.

    Thanks for letting me bounce ideas off you folks!

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,365

    Re: Adding TextBox Value Next to Existing Item in ListBox

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Populate Textbox from offset cells when selecting listbox item
    By Glherriott in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-30-2016, 02:00 AM
  2. adding new item in dropdown & using existing item as new record
    By lui de sagun in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-05-2015, 02:33 AM
  3. [SOLVED] Add TextBox for each item checked in ListBox
    By xforce1983 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-10-2015, 03:33 PM
  4. [SOLVED] Selected Listbox Item to Textbox
    By TheRobsterUK in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-17-2014, 04:07 PM
  5. [SOLVED] Displaying item from a listbox in a textbox with next 2 columns
    By kmakjop in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-25-2014, 08:44 PM
  6. [SOLVED] Display Selected Item in Listbox in Textbox
    By puuts in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-14-2014, 04:19 PM
  7. Select listbox item then appear textbox
    By sohaila in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-01-2013, 04:41 AM

Tags for this Thread

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