F
Fab61
Guest
Bonjour,
J'ai un userform avec une fonction recherche qui marche trés bien, cepedant j'ai ajouter une feuille et suivant la feuille en cours ma fonction recherche avec le bonton 'OK' doi s'apater a celle ci et je n'arrive pas a mettre la feuille en cours en tant que variable
voici mon code pour la feuille :
Donc en gros c de lui dure que si on est sur la sheet1 donc rechercher sur celle ci si on est sur la sheet2 rechercher sur celle ci ...
Merci
Fabien
J'ai un userform avec une fonction recherche qui marche trés bien, cepedant j'ai ajouter une feuille et suivant la feuille en cours ma fonction recherche avec le bonton 'OK' doi s'apater a celle ci et je n'arrive pas a mettre la feuille en cours en tant que variable
voici mon code pour la feuille :
Code:
Private Sub cmd_choix_refOK_Click()
On Error GoTo ErrHandler
Dim CurrentRow As Range
If Sheets('[color=#FF0000]LAFEUILLEENCOURS[/color]').Select = True Then
[color=#FF0000]LAFEUILLEENCOURS[/color].Range('B1').Select
MyFirstAddress = ''
If cxbreferencefiltre.Text = '' Then Exit Sub
Set MyCell = Cells.Find(What:=cxbreferencefiltre.Text, After:=[color=#FF0000]LAFEUILLEENCOURS[/color].Range('b1'), LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False)
Exit Sub
End If
If Not (MyCell Is Nothing) Then
MyCell.Select
MyFirstAddress = MyCell.Address
Set CurrentRow = Selection.EntireRow
Else
MsgBox 'Aucune Fiche ne correspond...', vbExclamation
End If
Exit Sub
End Sub
Donc en gros c de lui dure que si on est sur la sheet1 donc rechercher sur celle ci si on est sur la sheet2 rechercher sur celle ci ...
Merci
Fabien