Afficher un message
Vieux 08/02/2005, 09h51   #6 (permalink)
salim
Guest
 
Messages: n/a
Par défaut Re: erreur 70 !!!! accès refusé

Bonjour tonio, @+Thierry

tonio j'ai repris ton code en ajoutant et en retirant un ou deux truc et je n'ai rencontré aucune erreur, jespère visé juste concernant tes attentes, sinon j'aurai mérité une fois de plus mon titre de membre du ZopXLD club ;-).

Option Explicit

Private Sub ListBox1_Click()
Dim PLAGE As Range
Dim CELL As Range
Set PLAGE = Worksheets(1).Range("B5", Range("B65536").End(xlUp)) 'Ici j'ai enlevé Derligne qui n'été pas déclarée.
For Each CELL In PLAGE
If CELL.Value = ListBox1.Value Then
TextBox1 = CELL.Offset(0, 1).Value
TextBox2 = CELL.Offset(0, 2).Value
TextBox3 = CELL.Offset(0, 3).Value
TextBox4 = CELL.Offset(0, -1).Value
TextBox5 = CELL.Offset(0, 4).Value
TextBox6 = CELL.Offset(0, 8).Value
TextBox8 = CELL.Offset(0, 9).Value

End If
Next CELL
CommandButton1.Visible = True
End Sub



Private Sub TextBox7_Change()
Dim WS As Worksheet
Dim PLAGE As Range, CELL As Range
Dim RECHERCHE As String, ADRESSE As String
Dim LIGNE As Variant
Dim C As Object


RECHERCHE = TextBox7
If RECHERCHE = "" Then Exit Sub

For Each WS In Worksheets
LIGNE = Worksheets(WS.Name).Range("" & "B" & "65536").End(xlUp).Row
Set PLAGE = Worksheets(WS.Name).Range("" & "B" & "2:" & "B" & LIGNE)
With PLAGE
Set C = .Find(RECHERCHE)
If Not C Is Nothing Then
ADRESSE = C.Address
Do
ListBox1.AddItem C
Set C = .FindNext(C)
Loop While Not C Is Nothing And C.Address <> ADRESSE 'Ici j'ai rajouté <> ADRESSE
End If
End With
Next WS

End Sub

salim membre du ZopXLD club