Hi,
I am still just not getting it.
I have a range on one sheet which I have added to an array and another range on another sheet added to an array
If value in array matches value in 2nd array I want to add that value to a 3rd array.
Just getting stumped here.
This is what I have to date..
Sub Count_Names()
Dim vaRoster() As Variant, vaNames() As Variant, vaPNames() As Variant, vaCNames() As Variant
Dim ln As Long, lm As Long
Dim l As Long, m As Long, vaCount As Integer
vaRoster = ActiveSheet.Range("C5:D24").Value
vaNames = Sheets("Name_Matrix").Range("B5:C68").Value
ReDim Preserve vaPNames(UBound(vaNames) + 1)
For ln = LBound(vaNames, 1) To UBound(vaNames, 1)
If vaNames(ln, 1) = "P" Then
vaPNames() = vaNames(ln, 2)
End If
Next ln
For l = LBound(vaRoster, 1) To UBound(vaRoster, 1)
For m = LBound(vaRoster, 2) To UBound(vaRoster, 2)
If vaRoster(l, m) <> "" Then vaCount = vaCount + 1
Next m
Next l
MsgBox vaCount
Thanks for your time
Lionel
Bookmarks