I have a routine that counts variables but I have to pass a string so it knows which one to test. There has to be a better way.
Code:
Private Function ArrayVariableCount(Arr As String)
Dim nonEmptyElements As Integer, i As Integer '
nonEmptyElements = 0: i = 0 '
If Arr = "SOA" Then '
For i = LBound(SOA) To UBound(SOA) '
If Not SOA(i) = "" Then '
nonEmptyElements = nonEmptyElements + 1 '
End If '
Next '
Else '
If Arr = "COA" Then '
For i = LBound(COA) To UBound(COA) '
If Not COA(i, 0) = "" Then '
nonEmptyElements = nonEmptyElements + 1 '
End If '
Next '
End If '
End If
ArrayVariableCount = nonEmptyElements '
End Function