如何拆分一个单元格中的分隔数据并针对分隔的每一项分隔数据重复相邻单元格

How do I split out delimited data in one cell and repeat the adjacent cell against each item of delimited data separated out

我有一个 excel 文件,其中一个单元格中包含应用程序列表,并且相邻单元格中的应用程序有多个分隔的用户名。我需要在一列中将用户从一个单元格分隔到多个单元格,同时为每个用户重复应用程序的名称

    Current data looks something like this;

    Column1        | Column 2
    Application 1  | User1,User2,User3
    Application 2  | User1,User2,User3

    I want to get an output to be something like this;
    Column 1       | Column 2   
    Application 1  |  User 1
    Application 1  |  User 2
    Application 1  |  User 3
    Application 2  |  User 1
    Application 2  |  User 2
    Application 2  |  User 3

我一直在研究索引匹配、VBA 等,但惨遭失败 - 我认为我迄今为止完成的任何代码都不相关

这是一个超级简单的方法:

Sub Reorg()
    Dim i As Long, N As Long, ap As String, arr, a
    Dim k As Long

    N = Cells(Rows.Count, "A").End(xlUp).Row
    k = 1

    For i = 1 To N
    ap = Cells(i, 1).Value
    arr = Split(Cells(i, 2).Value, ",")
        For Each a In arr
            Cells(k, 3).Value = ap
            Cells(k, 4).Value = a
            k = k + 1
        Next a
    Next i
End Sub

对于 AB 列中的原始数据: