Home > Software engineering >  VBA small white to parse the statement, from the beginning of the For loop statements don't kno
VBA small white to parse the statement, from the beginning of the For loop statements don't kno

Time:11-22

Sub (s)
Arr=[a1] CurrentRegion 'choose a1 - b35
The Set d=CreateObject (" scripting. The dictionary ")
ReDim BRR (1 To UBound (arr), 1 To 5)
For I=2 To UBound (arr)
If d.e xists (arr (I, 2)) Then
D (arr (I, 2))=d (arr (I, 2)) & "# #" & arr (I, 1) and "#" & I
The Else
D (arr (I, 2))=arr (I, 1) and "#" & I
End the If
Next
N=2
For Each k In d.k eys

If InStr (d (k), "# #")> 0, Then
Cells (n, 9)=k
Cells (n, 8)=Split (Split (d (k), "# #") (0), "#") (0)
Cells (n, 10)=Split (Split (d (k), "# #") (0), "#") (1)
Cells (n, 11)=Split (Split (d (k), "# #") (1), "#") (0)
Cells (n)=Split (Split (d (k), "# #") (1), "#") (1)
N=n + 1
End the If
Next
End Sub
  •  Tags:  
  • VBA
  • Related