Re : XL: visualisation de qqes colones
Bonjour
Merci pour cela
j'ai également trouvé un exemple sur le site qui m'a aidé
et merci beaucoup de votre aide.
Bruno
*******************
Dim lig As Long # variable globale
Private Sub CheckBox1_Change()
Feuil1.Activate
' On Error Resume Next
Feuil1.Cells(lig - 1, 1) = CheckBox1.Value
End Sub
Private Sub CommandButton1_Click()
Unload UserForm1
End Sub
'Private Sub CheckBox1_Click()
'Cells(k, 3 + dep) = TextBox2
'ajouter les changes dans un onglet de suivi
'End Sub
Private Sub ListBox1_Click()
If Me.ListBox1.ListCount = 0 Then Exit Sub
nom = Me.ListBox1.List(Me.ListBox1.ListIndex)
TextBox1 = nom
On Error Resume Next
lig = Application.Match(nom, Feuil1.Range("B1:B65000"), 0) + 1
If Err <> 0 Then Err = 0: Me.ListBox1.Clear: Exit Sub
CheckBox1.Value = Feuil1.Cells(lig - 1, 1)
TextBox2 = Feuil1.Cells(lig - 1, 3)
TextBox3 = Feuil1.Cells(lig - 1, 4)
TextBox4 = Feuil1.Cells(lig - 1, 5)
TextBox5 = Feuil1.Cells(lig - 1, 6)
'Feuil1.Cells(lig - 1, 1) = CheckBox1.Value
End Sub
Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode <> 13 Then Exit Sub
If Me.TextBox1 = "" Then Exit Sub
Me.ListBox1.Clear
With Feuil1.[B1:B5000]
Set c = .Find(TextBox1.Text, LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
Me.ListBox1.AddItem c.Value
ListBox1.Visible = True: ok = True
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
On Error Resume Next
Me.ListBox1.Selected(0) = True
'ListBox1.Visible = True
Me.ListBox1.SetFocus
End Sub
*********************************