Hi Huskersippi,
Below is the code that is assigned to the Userform. The first sub is the code that updates the 3 listboxes for each range you described when the value of the combobox changes. The second part is the Initialization for the form that populates the combobox when the Userform is first run. I used a combobox for the values in Column A and Listboxes to provide for the results.
Private Sub cboA_Change()
i = cboA.ListIndex + 1
' Populate Values for Columns B - E in listbox
With lstBE
.Clear
For j = 2 To 5
.AddItem Cells(i, j)
Next j
End With
' Populate Values for Columns G - K in listbox
With lstGK
.Clear
For j = 7 To 11
.AddItem Cells(i, j)
Next j
End With
' Populate value for Column F in listbox
With lstF
.Clear
.AddItem Range("F" & i)
End With
End Sub
Private Sub UserForm_Initialize()
' Get LastRow for Column A
NumRows = Application.Rows.Count
lastrow = Range(Cells(NumRows, 1), Cells(NumRows, 1)).End(xlUp).Row
' Populate cboA
With cboA
For i = 1 To lastrow
.AddItem Range("A" & i)
Next i
End With
End Sub
I have also attached the Userform.xlsm file which has the userform with the above code in it as an example.
Bookmarks