Hi Wazing, I think this amended code does what you're after.
Sub extract()
Dim delim As String, nextRow As Long, i As Long, j As Long
Dim ws1 As Worksheet, ws2 As Worksheet, tmpArr As Variant, tmpStr As String
Set ws1 = Sheets("Sheet1")
Set ws2 = Sheets("Sheet2")
delim = "href="""
nextRow = ws2.Range("A" & ws2.Rows.Count).End(xlUp).Row + 1
For i = 1 To ws1.Range("A" & ws1.Rows.Count).End(xlUp).Row
tmpArr = Split(Cells(i, 1).Value, delim)
tmpStr = Cells(i, 1).Offset(0, 1).Value
For j = 1 To UBound(tmpArr)
tmpArr(j - 1) = Left(tmpArr(j), InStr(1, tmpArr(j), """") - 1)
Next j
With ws2.Range("A" & nextRow).Resize(UBound(tmpArr), 1)
.Value = Application.Transpose(tmpArr)
.Offset(0, 1).Value = tmpStr
End With
nextRow = nextRow + UBound(tmpArr)
Next i
ws2.Range("$A:$B").RemoveDuplicates Columns:=Array(1, 2), Header:=xlNo
End Sub
Bookmarks