![]()
Function Expand(S As String) 'Handle floating letters 'Test Start If Mid(S, 2, 1) = "," Then S = Left(S, 1) & "(0)" & Right(S, Len(S) - 1) 'Test End If Mid(S, Len(S) - 1, 1) = "," Then S = S & "(0)" 'Test In Between For Count = 1 To Len(S) - 2 T = Mid(S, Count, 3) If Left(T, 1) = "," And Right(T, 1) = "," And Asc(Mid(T, 2, 1)) > 64 And Asc(Mid(T, 2, 1)) < 91 Then 'Found Letter S = Left(S, Count + 1) & "(0)" & Right(S, Len(S) - Count - 1) End If Next MyArray = Split(S, "),") T = UBound(MyArray) For Count = 0 To UBound(MyArray) If InStr(MyArray(Count), ",") = 0 Then Expand = Expand & MyArray(Count) & ")," Else T1 = Split(MyArray(Count), "(") T2 = Split(T1(1), ",") T = UBound(T2) For Counter = 0 To UBound(T2) Expand = Expand & T1(0) & "(" & T2(Counter) & ")," Next End If Next Expand = Left(Expand, Len(Expand) - 2) End Function
Bookmarks