Hi Norie,
Thanks for the further feedback. I must admin that I struggled with this all day yesterday (I'm a bit new to Excel Macros), and I finally gave up on comparison via the array. Instead, I used the values I had stored in cells in the Worksheet.
As I say, I'm not very experienced with coding, so I don't know how efficient the code below would be, but at least it works for me. I thought I'd share it in case someone else had the same need.
' Instantiate the Listbox to be updated with replica selections.
Set lbTM = ActiveSheet.ListBoxes(CBR)
' Set the Named Range of the Enterprise Resource Pool members list.
RP = "Table_LUT_Resource_Pool"
' Use an array for comparison of selected verses available Team Members.
aryTList = Range(RP).value
' Before setting the replica selections, run through as initialze all selections to none.
For u = 1 To UBound(aryTList)
lbTM.Selected(u) = False
Next u
' Now run through and set the selections based on the replicated Project.
For s = 0 To 9
x = Range(FM).Offset(0, s)
For t = 1 To UBound(aryTList)
y = aryTList(t, 1)
If x = y Then
lbTM.Selected(t) = True
GoTo NextTM
End If
Next t
NextTM:
Next s
I also thought I'd share it in case someone might point me in the right direction on if there's a better way to code this.
Anyway, thanks for your support. It helped me get pointed in the right direction.
Cheers,
Wayne
Bookmarks