I have a variable set of strings inside the cells to be found in a sheet, like "horse" "apple" "apple/2" "cat", etc.
I need only copy the found string and paste it to next cell.
For example.:
A cell in column B is "Today the horse is happy". So i need only copy the word "horse" and paste it to the next cell. Another cell in column B cointains for example "The cat is sleeping". So i need only copy the word "cat" and paste it to the next cell.
I have a group of possible strings to be found in all column B.
Sub TEST()
Dim c As Range
For Each c In Range("B1:B1500")
If InStr(1, c.Text, "horse") Then
c.Copy Destination:=c.Offset(ColumnOffset:=1)
End If
Next c
End Sub
With that i copy the entire cell cointaining "horse", but i only need the single "horse" word.
Also, i have to duplicate or triple this code only changing the string. Is not a fast way since it will read each cell trying find one string then all the same with next one.
I wanted paste all the strings i want: (cat, horse, appple, etc) then if found one of then in a cell of column B, paste ONLY the found string to next cell.
Someone can help me?