Hi, @jtm2020hyo
I added some part of code showing you how to count the total count of A*, B*, C* with "Like" function always available in Excel.
As final result you will have three different variable with count of A* composed by the total count a comma, and text counted.
FinalStringA = 8,A*
FinalStringB = 11,B*
FinalStringC = 11,C*
Again I don't know how your source string is composed, here an example with A* B* C* search criteria (so for example A1, A2, B1, B2, C1, C2, etc)
If you want to create an array of final result you can.
I hope the can help you more, but I'm not in your mind, and I don't have the entire string.
For Example I applied the UBound(arrSplitStrings2) - 1 because last char in the source string it's "blank" so the split function create the 7 position of array empty. But I don't know if you will have blank char in your string or source array.
For the same reason (presence of blank char before A or B or C) I used like "*A*" so all string containing any char before A and any char after A will be considered valid for count of type "A", "B" and "C".
Sub SplitArrSource()
ArrSource = "A1,B2,C1; A2,B2,C1; A3,B2,C2; A4,B2,C2;A5,B2,C3; A6,B2,C4; A7,B2,C5;"
N = 0
Dim arrSplitStrings2() As Variant
Dim CountA As Integer
Dim CountB As Integer
Dim CountC As Integer
arrSplitStrings1 = Split(ArrSource, ";")
For X = LBound(arrSplitStrings1) To UBound(arrSplitStrings1)
ReDim Preserve arrSplitStrings2(N)
arrSplitStrings2(N) = Split(arrSplitStrings1(X), ",")
N = N + 1
Next
For XX = LBound(arrSplitStrings2) To UBound(arrSplitStrings2) - 1
StringA = arrSplitStrings2(XX)
If StringA(0) Like "*A*" = True Then
CountA = CountA + 1
FinalStringA = CStr(CountA) & "," & "A*"
End If
If StringA(1) Like "*B*" = True Then
CountB = CountB + 1
FinalStringB = CStr(CountB) & "," & "B*"
End If
If StringA(2) Like "*C*" = True Then
CountC = CountC + 1
FinalStringC = CStr(CountC) & "," & "C*"
End If
Next XX
Debug.Print FinalStringA
Debug.Print FinalStringB
Debug.Print FinalStringC
End Sub