Sub En_attendant_la_rentrée()
Dim vChaine$
vChaine = "chris4785478547"
MsgBox extraire(vChaine, 5)
MsgBox extraire(vChaine, 5, "D")
MsgBox extraire(vChaine, 8, "PapaWasARollingStone")
End Sub
Private Function extraire(chaine, vNB, Optional SENS = "G") As String
Dim tmp$
Select Case SENS
Case "G"
tmp = Left(chaine, vNB)
Case "D"
tmp = Right(chaine, vNB)
Case Else
tmp = Mid(chaine, 1, vNB)
End Select
extraire = tmp
End Function