VLookup for Dynamic ListBox (Form)

Pibe_CR

New Member
Joined
Jun 4, 2014
Messages
1
Hello Everyone,

I have used this forum and has proved very useful with all your input so now I am in need of this knowledge. I have been struggling to get a list box (In a user form) to update its values using VLookup dynamically after the first condition is met in a previous list box. The main problem I encounter is that I cannot make the list with the different values but only with the first value that meets the criteria of the VLookup the number of time that equals the number of rows (due to the cell range)

My Code for that specific part looks as seen below:
Code:
Private Sub AgentName_DropButt*******()    Dim rg As Range
    Dim MgrName As String
    Dim vlookupval As Variant
    Dim cl As Range
   
    MgrName = ManagerName.Value
    Set rg = Range("Agents")
    For Each cl In rg
        vlookupval = Application.VLookup(MgrName, Range("AgentsTable"), 2, False)
        With Me.AgentName
            .AddItem (vlookupval)
        End With
    Next
End Sub

If the spreadsheet is needed let me know I may need to edit the data a bit.

Thanks in advance

More Info: Excel 2007
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Forum statistics

Threads
1,215,523
Messages
6,125,317
Members
449,218
Latest member
Excel Master

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top