I am trying to determine values in one array and pass them into another array. Below is my code:
What I'm trying to do is find any text value in teamTfArray that doesn't equal "" and pass it into an element in prntTeamArray. It gives me a MisMatch error and I'm not sure why?
Code:
'Print selected teams to Metrics-Site worksheet
Dim teamTfArray() As Variant
Dim prntTeamArray() As Variant
Dim x, j, z
j = 0
z = Sheets("Valid Values").Range("cbTeamTotal").Value
ReDim prntTeamArray(1 To z)
teamTfArray() = Sheets("Valid Values").Range("TeamTF").Value
For Each x In teamTfArray()
If x = "" Then
Else
j = 1 + j
prntTeamArray(j) = teamTfArray(x)
End If
Next x
What I'm trying to do is find any text value in teamTfArray that doesn't equal "" and pass it into an element in prntTeamArray. It gives me a MisMatch error and I'm not sure why?