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:
If the spreadsheet is needed let me know I may need to edit the data a bit.
Thanks in advance
More Info: Excel 2007
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