Me.Text1.Text = "Informatique;Moniteur;Moniteur 19'' et moins;" & vbCrLf Me.Text1.Text = Me.Text1.Text & ":DVD;DVD Séries TV;Séries TV Comédie;" & vbCrLf Me.Text1.Text = Me.Text1.Text & "Informatique;Composant;Carte graphique;" & vbCrLf Me.Text1.Text = Me.Text1.Text & "GPS;GPS;GPS pour la route;" & vbCrLf Me.Text1.Text = Me.Text1.Text & "GPS;Accessoires GPS;Chargeur voiture;" & vbCrLf Me.Text1.Text = Me.Text1.Text & "DVD;DVD Séries TV;Séries TV Policier, Thriller;" & vbCrLf Me.Text1.Text = Me.Text1.Text & "DVD;DVD Séries TV;Séries TV Médicales;" & vbCrLf
Private Sub replacefirstocurrence(thetext As String, what As String, withwhat As String) Dim pos As Integer Dim start As Integer Dim newstr As String Dim endofstring As Boolean Dim mystrings() As String mystrings() = Split(thetext, vbCrLf) For iter = LBound(mystrings) To UBound(mystrings) pos = InStr(1, mystrings(iter), what) newstr = "" If pos = 1 Then newstr = withwhat & Mid(mystrings(iter), Len(withwhat)) mystrings(iter) = newstr & vbCrLf Else mystrings(iter) = mystrings(iter) & vbCrLf End If Next iter Me.Text1.Text = "" For iter = LBound(mystrings) To UBound(mystrings) Me.Text1.Text = Me.Text1.Text & mystrings(iter) Next iter End Sub
replacefirstocurrence Me.Text1.Text, "GPS", "GPS1"
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question