j'ai un combobox combiné a un text box qui permettent d'alimenter une listview
malheureusement, quand j'exécute la macro, des fois, elle met ERREUR D'EXECUTION 13. d'autres fois c'est IMPOSSIBLE D'EXECUTER EN MODE ARRET; voici la macro en question. et une esquisse de fichier.
Private Sub TextBox1_Change()
If ComboBox1 <> "" And TextBox1 <> "" Then
Cells(ComboBox1.ListIndex + 7, 19) = TextBox1 * 1
End If
Dim i As Integer, pos As Byte
With ComboBox1
pos = Len(.Text)
If pos > 0 Then
For i = 0 To .ListCount - 1
If Left(.List(i), pos) = .Text Then
.ListIndex = i
.SelStart = pos
.SelLength = Len(.Text) - pos
End If
Next i
End If
End With
End Sub
malheureusement, quand j'exécute la macro, des fois, elle met ERREUR D'EXECUTION 13. d'autres fois c'est IMPOSSIBLE D'EXECUTER EN MODE ARRET; voici la macro en question. et une esquisse de fichier.
Private Sub TextBox1_Change()
If ComboBox1 <> "" And TextBox1 <> "" Then
Cells(ComboBox1.ListIndex + 7, 19) = TextBox1 * 1
End If
Dim i As Integer, pos As Byte
With ComboBox1
pos = Len(.Text)
If pos > 0 Then
For i = 0 To .ListCount - 1
If Left(.List(i), pos) = .Text Then
.ListIndex = i
.SelStart = pos
.SelLength = Len(.Text) - pos
End If
Next i
End If
End With
End Sub