Aide sur une formule
d
Bonjour,
j'ai une formule qui bloque pour effectuer des recherche sur 4 colonnes différentes
Private Sub CommandButton5_Click()
' Chercher
Dim Cel As Range
If Trim(Me.TextBox0a_Recherche) = "" Then Exit Sub
Set Cel = WsA.Columns(1).Find(what:=Me.TextBox0a_Recherche, LookIn:=xlValues, lookat:=xlPart)
If Not Cel Is Nothing Then
Me.SpinButton1.Value = Cel.Row
Else
Set Cel = WsA.Columns(2).Find(what:=Me.TextBox0a_Recherche, LookIn:=xlValues, lookat:=xlPart)
If Not Cel Is Nothing Then
Me.SpinButton1.Value = Cel.Row
Else
Set Cel = WsA.Columns(8).Find(what:=Me.TextBox0a_Recherche, LookIn:=xlValues, lookat:=xlPart)
If Not Cel Is Nothing Then
Me.SpinButton1.Value = Cel.Row
Else
Set Cel = WsA.Columns(8).Find(what:=Me.TextBox0a_Recherche, LookIn:=xlValues, lookat:=xlPart)
If Not Cel Is Nothing Then
Me.SpinButton1.Value = Cel.Row
Else
Me.Label15.Visible = True
EffaceControles
End If
End SubL'un d'entre vous à la solution. Si vous pouviez m'expliquer histoire que je m'endorme un peu moins bête ce soir.
Merci d'avance.
David
Bonjour
Sans fichier pas terrible d'avoir la solution
Mais si tu indentes correctement ton code tu t'apercevrais qu'il manque beaucoup de End If
Private Sub CommandButton5_Click()
' Chercher
Dim Cel As Range
If Trim(Me.TextBox0a_Recherche) = "" Then Exit Sub
Set Cel = WsA.Columns(1).Find(what:=Me.TextBox0a_Recherche, LookIn:=xlValues, lookat:=xlPart)
If Not Cel Is Nothing Then
Me.SpinButton1.Value = Cel.Row
Else
Set Cel = WsA.Columns(2).Find(what:=Me.TextBox0a_Recherche, LookIn:=xlValues, lookat:=xlPart)
If Not Cel Is Nothing Then
Me.SpinButton1.Value = Cel.Row
Else
Set Cel = WsA.Columns(8).Find(what:=Me.TextBox0a_Recherche, LookIn:=xlValues, lookat:=xlPart)
If Not Cel Is Nothing Then
Me.SpinButton1.Value = Cel.Row
Else
Set Cel = WsA.Columns(8).Find(what:=Me.TextBox0a_Recherche, LookIn:=xlValues, lookat:=xlPart)
If Not Cel Is Nothing Then
Me.SpinButton1.Value = Cel.Row
Else
Me.Label15.Visible = True
EffaceControles
End If
End If
End If
End If
End SubSi pas ça Il faudra ton fichier
Au fait il tu vérifies 2 fois la colonne 8
d
Merci
Effectivement j'ai également trouvé l'absence des "end if" avant ta solution pourtant ct évident mais cela arrive et ça fonctionne parfaitement.
Concernant la colonnes 8 & 9 j'avais également corrigé mon erreur, mais merci quand même.