Sub extraire()
Dim Arr
Arr = Range("A2:C7")
For i = LBound(Arr) To UBound(Arr)
If Arr(i, 2) Like "*-C_*" Then
Range("C" & i).Value = Left(Arr(i, 2), Find("-", Arr(i, 2) - 1)) & "_" & Split(Arr(i, 2), "_")(1)
Else
Range("C" & i).Value = Left(Arr(i, 2), Find("-", Arr(i, 2) - 1)) & "_" & Arr(i, 1)
End If
Next i
End Sub