Bonjour,
Je tente d'effectuer une recherche dans une colonne dont chaque élément (cellule) contient une formule.
Ma commande Find ne trouve pas l'élément recherché. On dirait que ma recherche ne tient pas compte du résultat des formules.
Merci pour votre aide.
Voici mon code:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 Sub ChercheFiches() Dim Trouve As Range Dim PlageDeRecherche As Range Dim Valeur_Cherchee As String Dim AdresseTrouvee As String Set PlageDeRecherche = Nothing Set Trouve = Nothing Sheets("Fiches service").Select Range("a1").Select Valeur_Cherchee = "Admin 2001" Set PlageDeRecherche = ActiveSheet.Columns(1) Set Trouve = PlageDeRecherche.Cells.Find(what:=Valeur_Cherchee, LookIn:=xlFormulas, LookAt:=xlWhole) If Trouve Is Nothing Then GoTo PackagenonTrouvé Else AdresseTrouvee = Trouve.Address Range(AdresseTrouvee).Select GoTo PackageTrouvé End If PackagenonTrouvé: Set PlageDeRecherche = Nothing Set Trouve = Nothing MsgBox ("non trouvé") GoTo fin PackageTrouvé: MsgBox ("trouvé") fin: End Sub
Partager