I'm trying to achieve a simple way to assign employee for a specific job.
Having Table1 (Employee skills), and have Table2 (Job Requirements). I want to be able to check if an employee has enough skills to be capable of doing a certain job.
This way, I have two listbox, Listbox1 as Table1 and Listbox2 as Table2. I have the following code to find the index of a specific line in Listbox1 and Listbox2
Dim i As Integer
Dim j As Integer
With ListBox1
.MultiSelect = fmMultiSelectSingle
.ListIndex = -1
.MultiSelect = fmMultiSelectMulti
For i = 0 To .ListCount - 1
For j = 0 To .columnCount - 1
If ComboBox2.Value = .Column(j, i) Then
.ListIndex = i
.Selected(i) = True
End If
Next j
Next i
End With
After identifying the row of the employee and the row of the job in the Listbox1 and 2 I want to check match values between them, and show the values that match on Listbox3. I currently have the following code, but only works with Listbox with one column:
Dim i As Long, j As Long
Dim fMatch As Long
For i = 1 To ListBox1.ListCount
fMatch = False
For j = 1 To ListBox2.ListCount
If ListBox1.List(i - 1) = ListBox2.List(j - 1) Then
fMatch = True
Exit For
End If
Next j
If fMatch Then
ListBox3.AddItem ListBox1.List(i - 1)
End If
Next i
I'm also trying to get a list of best employees to fit the role in listbox3.
