Private Sub CommandButton1_Click() Dim pas As Integer pas = 3 Static devant As Integer toto = Split(TextBox1.Text, vbNewLine) For i = 0 To UBound(toto) toto(i) = Trim(toto(i)) If i > 0 Then avant = Trim(toto(i - 1)) If LCase(avant) Like "if*then" Then devant = devant + pas End If If LCase(toto(i)) Like "end*" Then devant = devant - pas End If toto(i) = String(devant, " ") & toto(i) Next TextBox1.Text = Join(toto, vbCrLf) End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionNext TextBox1.Text = Join(toto, vbCrLf) devant = 0 End Sub