This will not work but is just a example of Case
Based on the value of the Selector (in Select Case) on of the Case …. statements is selected and associated code executed
Option Explicit
Sub extrair()
Dim i As Long
For i = 1 To 20
Select Case Worksheets("ddp").Cells(i, 1).Value
Case "3.3190.03.01"
Worksheets("ddp").Cells(1, 4).Value = Worksheets("ddp").Cells(i, 1).Value
Case "3.3190.03.03"
Worksheets("ddp").Cells(2, 4).Value = Worksheets("ddp").Cells(i, 1).Value
Case "3.3190.03.86"
Worksheets("ddp").Cells(3, 4).Value = Worksheets("ddp").Cells(i, 1).Value
End Select
Next i
End Sub
I think you're looking for something like this
Sub OptionalWay()
Dim r As Range
Dim i As Long
Dim v As Variant
With Worksheets("ddp")
v = Application.WorksheetFunction.Transpose(.Cells(1, 1).CurrentRegion.Columns(1).Value)
For Each r In .Cells(1, 3).CurrentRegion.Cells
For i = LBound(v) To UBound(v)
If Len(v(i)) > 0 Then
If InStr(v(i), r.Value) > 0 Then
r.Offset(0, 1).Value = v(i)
Exit For
End If
End If
Next i
Next
End With
End Sub