Try the next code, please. It uses arrays and should be very fast for big ranges. It works only in memory and drops the processing result at once:
Sub testExtractText()
Dim sh As Worksheet, sh1 As Worksheet, lastRow As Long, lastRow2 As Long, arr As Variant
Dim arrFinA As Variant, arrFinF As Variant, arrSearch As Variant, El As Variant, i As Long, k As Long
Set sh = Worksheets("sheet to be processed") 'use here your sheet
Set sh1 = Worksheets("sheet to receive the return") 'use here your sheet
lastRow = sh.Range("A" & Rows.count).End(xlUp).row
arrSearch = Split("usd,yp,hx", ",")
arr = sh.Range("A2:A" & lastRow).value
ReDim arrFinA(1 To 1, 1 To lastRow) 'reverse rows with columns to finally ReDim Preserve
ReDim arrFinF(1 To 1, 1 To lastRow)
k = 1
For i = 1 To UBound(arr)
For Each El In arrSearch
If InStr(arr(i, 1), "-" & El & "-") > 0 Then
arrFinA(1, k) = Split(arr(i, 1), "-")(0)
arrFinF(1, k) = UCase(Split(arr(i, 1), "-")(1))
k = k + 1: Exit For
End If
Next
Next i
ReDim Preserve arrFinA(1 To 1, 1 To k - 1) 'keep only the filled elements
ReDim Preserve arrFinF(1 To 1, 1 To k - 1)
lastRow2 = sh1.Range("A" & Rows.count).End(xlUp).row + 1
sh1.Range("A" & lastRow2).Resize(UBound(arrFinA, 2), 1).value = WorksheetFunction.Transpose(arrFinA)
sh1.Range("F" & lastRow2).Resize(UBound(arrFinF, 2), 1).value = WorksheetFunction.Transpose(arrFinF)
End Sub
Please, take care to appropriately change the necessary sheets name (sh
and sh1
).