probleme avec la fonction: FIND
Bonjour tout le monde du forum,
Me revoila avec mes questions!!!!!!!!!!!!:oops:
Dans la macro ci-dessous, je fais une recherche d'un nom (NM1) de la feuille "brioche" dans la feuille"BL"; mon probleme est que si le nom n'existe pas dans "BL" je veux revenir dans "brioche", mais je ne trouve pas la bonne synthaxe.........
Code:
If NM1.Find(cell.Value, LookIn:=xlValues) Is Nothing Then Sheets("brioche").Select
Quelqu'un pourrait-il m'aider sur ceci S.V.P
Merci d'avance, je sais que sur ce site il y a toujours des personnes sympas pour aider
:ccool:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
Sub Macro25()
'
'
' copie de "brioche' vers "BL"
'
'
Dim NM1 As String
Sheets("brioche").Select
If Worksheets("brioche").AutoFilterMode Then
Selection.AutoFilter
End If
Range("B3").Select
NM1 = ActiveCell.Value
While ActiveCell <> ""
Sheets("BL").Select
If Worksheets("BL").AutoFilterMode Then
Selection.AutoFilter
End If
Columns("B:B").Select
Selection.Find(What:=NM1, After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=True, SearchFormat:=False).Select
If NM1.Find(cell.Value, LookIn:=xlValues) Is Nothing Then Sheets("brioche").Select
ActiveCell.Offset(0, 6).Select
ActiveCell.Value = "X"
Sheets("brioche").Select
ActiveCell.Offset(1, 0).Select
NM1 = ActiveCell.Value
Wend
End Sub |