+ Reply to Thread
Results 1 to 4 of 4

Listbox and Userform to populate textbox - Help!

  1. #1
    Registered User
    Join Date
    03-03-2015
    Location
    England
    MS-Off Ver
    2013
    Posts
    32

    Listbox and Userform to populate textbox - Help!

    Hi all

    I have a question about the most efficient and effective way of doing the following:

    I have created something in VBA that logs lap times etc. for a computer racing game. There are 10 races in total (each race has its own userform) that have lap times, the date the time was set, and the driver's name (three people are available). Each of these 10 races provides the option of 'Update Name' to allow me to select the person (of the three total) who completed that particular fastest lap.

    The listbox (which contains the three names) is part of another userform which is shown when 'Update Name' is pressed. Then, when a name is selected, the relevant 'Driver Name' box is filled out on that particular race's userform. However, unless I create 10 separate 'Driver List' userforms (each containing a listbox with the three names), I don't see how I can get VBA to know which Driver Name box to fill out (because in the driver list userform, I need to tell it which race's 'Driver Name' textbox to fill in).

    I have a solution using a cell in Excel as a reference, but I'm not happy with that, as I feel there's something in VBA which can do this (without creating 10 separate 'Driver List' userforms).

    Hopefully that makes sense -- I haven't included code because there isn't really much I can offer when I don't know what the code would be!

    Thanks in advance.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Listbox and Userform to populate textbox - Help!

    Why do you need more that one Userform?

    It sounds quite basic
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    03-03-2015
    Location
    England
    MS-Off Ver
    2013
    Posts
    32

    Re: Listbox and Userform to populate textbox - Help!

    I'm open to ideas...

    The reason I've posted is because I think there's a simpler way, but I don't want to use separate listboxes or a cell in excel to refer to.

    What are you thinking?

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Listbox and Userform to populate textbox - Help!

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

+ 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. [SOLVED] (ActiveX) Populate Listbox With Textbox
    By elsg in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-25-2015, 02:22 PM
  2. Replies: 0
    Last Post: 08-19-2013, 05:12 AM
  3. [SOLVED] populate userform listbox from textbox input
    By cfinch100 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-05-2013, 10:05 AM
  4. VBA - Populate Listbox based on value selected in another ListBox (On Userform)
    By raaboo in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-12-2012, 11:18 AM
  5. Populate userform listbox based on value selected in another listbox
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-07-2012, 05:16 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