Option Explicit
Sub TEST()
Dim Brr, Crr, Y, Z, i&, T1$, T2$
'↑宣告變數
Set Y = CreateObject("Scripting.Dictionary")
'↑令Y變數是 字典
Brr = Range([B10], [B65536].End(3))
'↑令Brr變數是 二維陣列,以B欄儲存格值帶入
Crr = Range([H22], [G65536].End(xlUp))
'↑令Crr變數是 二維陣列,以G~H欄儲存格值帶入
For i = 1 To UBound(Crr)
'↑設順迴圈 (拆解組別對應成員(G欄),裝入Y字典中)
T1 = Crr(i, 1): T2 = Crr(i, 2)
'↑令變數承裝迴圈陣列值
If (T1 = "") * (T2 = "") Then GoTo i01
'↑忽略空格
For Each Z In Split(T1, ",")
'↑設逐項迴圈!令Z變數是 (G欄)值以","分割的一維陣列子
If Z = "" Then GoTo z01
'↑如果Z變數是空字元!就跳到z01標示位置繼續執行
Y(Z) = T2
'↑令以Z變數當key,item是T2變數(組名)
z01: Next
i01: Next
For i = 1 To UBound(Brr)
'↑設順迴圈 (將欲辨識的成員當key,查Y字典得到組名)
Brr(i, 1) = Y(Brr(i, 1) & "")
'↑令查Y字典得到組名覆蓋掉原來Brr的成員
Next
[L10].Resize(UBound(Brr), 1) = Brr
'↑令Brr陣列值從[L10]開始寫入儲存格中
Set Y = Nothing: Erase Brr, Crr
'↑令釋放變數
End Sub