stratthaslam
Board Regular
- Joined
- Feb 4, 2009
- Messages
- 63
Hi all,
Thanks in advance for your help. What I have is a Userform that I want to populate team member names based on which supervisor is selected in a combobox. The code I have now can overwrite all the label captions but overwrites all of the with the same name instead of each individual name. So a team with 17 names shows with 17 Bob's instead of all 17 people's names.
Here is what I have...just a little tweaking needed but can't quite figure it out
Thanks in advance for your help. What I have is a Userform that I want to populate team member names based on which supervisor is selected in a combobox. The code I have now can overwrite all the label captions but overwrites all of the with the same name instead of each individual name. So a team with 17 names shows with 17 Bob's instead of all 17 people's names.
Here is what I have...just a little tweaking needed but can't quite figure it out
Code:
Dim MyRng As Range
Set MyRng = Sheets("Roster").Range("A2:A250")
For Each cell In MyRng
If cell.Value = Supervisor.Value Then
For q = 1 To 25
Me.Controls("Name" & q).Caption = cell.Offset(0, 1)
Next q
End If
Next cell