maval
XLDnaute Barbatruc
Bonjour
J'ai code pour recherche un mot d'ans une liste qui fonctionne très bien sauf qu'il ne faut pas qu'il agisse sur les 3 première lignes. Alors qu'il les écrase toujours.
Mon code:
Je vous remercie de votre aide
J'ai code pour recherche un mot d'ans une liste qui fonctionne très bien sauf qu'il ne faut pas qu'il agisse sur les 3 première lignes. Alors qu'il les écrase toujours.
Mon code:
Code:
Private Sub CommandButton1_Click()
Dim rng As Range, c As Range, T() As Variant, L As Long
If TextBox1 = "" Then Exit Sub
x = 1
With ActiveSheet
.Cells.EntireRow.Hidden = False
Set rng = .Range("A4").CurrentRegion
With rng
Set c = .Find(What:=TextBox1, LookAt:=xlPart, MatchCase:=False)
If Not c Is Nothing Then
Adresse = c.Address
Do
ReDim Preserve T(1 To x)
T(x) = c.Row
x = x + 1
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> Adresse
End If
End With
On Error Resume Next
L = UBound(T)
If L = 0 Then
MsgBox "aucun item trouvé"
Else
Application.ScreenUpdating = False
On Error GoTo 0
rng.EntireRow.Hidden = True
For i = 1 To UBound(T)
.Rows(T(i)).EntireRow.Hidden = False
Next
Application.ScreenUpdating = True
End If
End With
End Sub
Je vous remercie de votre aide