我试图在单个Orgs的col A中退出时在逗号上拆分单元格值

然后我想将拆分单元格的元素与工作表Orgs_Helper上的A列中的值列表进行匹配

但我的Sud总是说有一场比赛,尽管那是不可能的

谢谢

组织表看起来像:

ColA
Maryland Community Health Resources Commission
Baltimore City Schools


CDPH
DPSS, DMH
Alex
DHS, DPH, DPSS, LASD
Los Angeles Sherrif Dept, Whole Person Care, Housing for Health, Office of 
Immigrant Affairs
LAC+USC Medical Center

Middlesex Sheriff's Office

Behavioral Health Systems Baltimore
NIH

Orgs_Helper看起来像

ColAor
AACP
Alex
Baltimore City Schools
Behavioral Health Systems Baltimore
Boys and Girls Club
Department of Health
Department of Labor
Department of Social Services
HOPWA
Housing Authority
Housing for Health
HUD
Justice System
LAC+USC Medical Center
LASD
Los Angeles Sherrif Dept

我到目前为止Sub FindReplace_DilimCellValues()Dim G As Variant Dim wsFV As Worksheet,wsRV As Worksheet Dim sLR As Long,tLR As Long,i As Long,n As Long

Set wsFV = ThisWorkbook.Worksheets("Orgs")
Set wsRV = ThisWorkbook.Worksheets("Orgs_Helper")

sLR = wsFV.Range("A" & wsFV.Rows.Count).End(xlUp).Row
tLR = wsRV.Range("A" & wsRV.Rows.Count).End(xlUp).Row

    For i = 2 To sLR

      G = Split(wsFV.Cells(i, 1).value, ", ")
      For n = LBound(G) To UBound(G)
            If Not IsError(Application.Match(splitCell(wsFV.Cells(i, 1).value, ", ", n), wsRV.Range("A2:A" & tLR), 0)) Then
              MsgBox "Match found"

          End If
       Next n

    Next i
End Sub

助手功能:

Function splitCell(strValue As String, delim As String, n As Long) As String

  If strValue <> "" Then
   splitCell = Split(strValue, delim)(n)
 Else
   strValue = ""
 End If

结束功能