you can take the cells(r2,10) and cells(r2,11) entries I added them as checkups
Sub basket()
On Error Resume Next
r = 3
tr = Cells(2, 1)
Item = Cells(2, 2)
r2 = 2
r3 = 3
While Cells(r, 1) <> ""
If Cells(r, 1) <> tr Then
o = 1
k = 1
If Len(Item) > 1 Then
While o = 1
For i = 1 To Len(Item)
For j = i + k To Len(Item)
entry = Mid(Item, i, k) & Mid(Item, j, 1)
Cells(r2, 10) = tr
Cells(r2, 11) = entry
r2 = r2 + 1
x = 0
x = Application.WorksheetFunction.Match(entry, Range("g:g"), 0)
If x = 0 Then
x = r3
Cells(x, 5) = entry
r3 = r3 + 1
End If
Cells(x, 6) = Cells(x, 6) + 1
Next j
Next i
If k > Len(Item) - 1 Then o = 0
k = k + 1
Wend
End If
Item = ""
tr = Cells(r, 1)
End If
Item = Item + Cells(r, 2)
r = r + 1
Wend
o = 1
k = 1
If Len(Item) > 1 Then
While o = 1
For i = 1 To Len(Item)
For j = i + k To Len(Item)
entry = Mid(Item, i, k) & Mid(Item, j, 1)
Cells(r2, 10) = tr
Cells(r2, 11) = entry
r2 = r2 + 1
x = 0
x = Application.WorksheetFunction.Match(entry, Range("g:g"), 0)
If x = 0 Then
x = r3
Cells(x, 5) = entry
r3 = r3 + 1
End If
Cells(x, 6) = Cells(x, 6) + 1
Next j
Next i
If k > Len(Item) - 1 Then o = 0
k = k + 1
Wend
End If
End Sub
Bookmarks