Results 1 to 3 of 3

Populating textboxes based on multiple combobox selections

Threaded View

hannvis Populating textboxes based on... 07-31-2019, 03:08 PM
AlphaFrog Re: Populating textboxes... 07-31-2019, 04:54 PM
hannvis Re: Populating textboxes... 07-31-2019, 05:02 PM
  1. #1
    Registered User
    Join Date
    07-27-2019
    Location
    https://t.me/pump_upp
    MS-Off Ver
    Office 365
    Posts
    2

    Populating textboxes based on multiple combobox selections

    Hi all, I currently have a userform that has 4 comboboxes, all filtering from a table, with the last combobox being filtered to a single row match in the table. Once that match is made, textboxes are filled with the data contained in the adjacent row in the table.

    I am using the below code to fill in these textboxes

    Sub GetDataCBbased()
    
        Dim wo As Long, i As Integer, j As Integer, flag As Boolean
    
        If IsNumeric(UserForm1.ComboBox4.Value) Then
            flag = False
            i = 0
            wo = UserForm1.ComboBox4.Value
    
            Do While Cells(i + 1, 1).Value <> ""
    
                If Cells(i + 1, 1).Value = wo Then
                    flag = True
                    For j = 5 To 12
                        UserForm1.Controls("TextBox" & j).Value = Cells(i + 1, j).Value
                    Next j
                End If
    
                i = i + 1
    
            Loop
    
            If flag = False Then
                For j = 5 To 12
                    UserForm1.Controls("TextBox" & j).Value = ""
                Next j
            End If
    
        Else
            ClearForm
        End If
    
    End Sub
    This all works fine, but the search is only being constrained to the selection made in the final combobox, this would be fine however, that value is not unique in the table, so I am missing rows of data in the results of my UserForm. So my question is if I can constrain the search to all the combobox selections rather than just the last one.

    Any assistance would be greatly appreciated as I've completely hit a roadblock with this. I attached the file below
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Populate multiple TextBoxes based on ComboBox Selection
    By PTechFL in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-23-2019, 06:35 AM
  2. Populating a ListBox based on 3 ComboBox selections
    By Raylou in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-01-2018, 08:46 AM
  3. Replies: 3
    Last Post: 03-22-2018, 11:25 AM
  4. Populating Combobox based on Combobox selection from EXCEL worksheet
    By JChaney17 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 08-04-2014, 08:14 AM
  5. Populating textboxes based on ComboBox value.....
    By harish_gr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-24-2013, 09:05 AM
  6. Replies: 3
    Last Post: 04-11-2013, 12:23 AM
  7. [SOLVED] Changeing Combobox Colors based on other combobox selections
    By dagindi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-15-2012, 11:42 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