bonsoir Damien , bonsoir Luc
peux tu préciser :
tu as un message d'erreur ?
lequel ?
à quelle ligne ?
à tout hasard ...
Private Sub TextBox1_Change()
Dim c As Range, lig As Range
Dim x As Long
If Not Len(TextBox1) = 0 And ListBox1.ListIndex = -1 Then
MsgBox 'veuiller changer de valeur'
Exit Sub
End If
TextBox1 = UCase(TextBox1)
With ListBox1
.Clear
.IntegralHeight = True
.Visible = True
.ColumnCount = 10
.ColumnWidths = '70;150;50;80;110;50;150;100;50;05'
For Each lig In Worksheets('liste').UsedRange.Rows
If Left(lig.Cells(2), Len(TextBox1)) = TextBox1 Then
.AddItem lig.Cells(1).Text
.List(x, 1) = lig.Cells(2).Text 'nom
.List(x, 2) = lig.Cells(3).Text 'lht
.List(x, 3) = lig.Cells(5).Text 'port d'attache
.List(x, 4) = lig.Cells(6).Text 'pavillon
.List(x, 5) = lig.Cells(7).Text ' callsign
.List(x, 6) = lig.Cells(8).Text 'type
.List(x, 7) = lig.Cells(10).Text
.List(x, 8) = lig.Cells(11).Text
.List(x, 9) = lig.Row
x = x + 1
If TextBox1 = '' Then
Exit Sub
ListBox1.Visible = False
End If
End If
Next lig
End With
End Sub
bonne soirée
MichelXld