Sub SeqToClip_V4()
Dim fRange As Range, kArea As Range
Dim fArr As String, I As Long, cFilt, J As Long
'
Set fRange = Range(Range("D1"), Range("D1").End(xlDown).Offset(0, 1)) 'Assuming the table starts in D1
'
For I = 16 To 1000
cFilt = Cells(I, "J").Value
If Len(cFilt) = 0 Then Exit For
fRange.AutoFilter Field:=1, Criteria1:="*" & cFilt & "*"
fArr = ""
For J = 1 To fRange.Rows.Count
'' If fRange.Cells(J, 1).Value = cFilt Then
If InStr(1, fRange.Cells(J, 1).Value, cFilt, vbTextCompare) > 0 Then
fArr = fArr & fRange.Cells(J, 0).Value & " - " & fRange.Cells(J, 1).Value & " - " & fRange.Cells(J, 2).Value & vbCrLf
End If
Next J
DoEvents
'
If Len(fArr) > 2 Then
fArr = fArr & fRange.Cells(J + 1, 1).Value & " - " & fRange.Cells(J + 1, 2).Value & vbCrLf
fArr = fArr & fRange.Cells(J + 2, 1).Value & " - " & fRange.Cells(J + 2, 2).Value & vbCrLf
SetClipBoardText (fArr) 'fRange.Cells(2, 1).Resize(fRange.Rows.Count - 2, 2).SpecialCells(xlCellTypeVisible).Value)
Beep
MsgBox ("Copy the clipboard data into WhatsApp Web; destination: " & Cells(I, "J").Value)
End If
'
Next I
fRange.AutoFilter Field:=1
MsgBox ("Completed")
End Sub
Function SetClipBoardText(ByVal Text As Variant) As Boolean
SetClipBoardText = CreateObject("htmlfile").ParentWindow.ClipboardData.SetData("Text", Text)
End Function