Fonction Find dans Macros et VBA Excel
Bonjour,
J'ai une question sur la fonction Find:
j'ai un onglet "Périmètre" qui contient:
Col A |
Col B |
Col C |
1.1 |
Test1 |
10.10 |
1.2 |
Test2 |
15.20 |
Dans un autre onglet "SYNTHESE", j'ai
Col A |
Col B |
Col C |
1.1 |
Test1 |
|
1.1.2 |
Test2 |
|
1.2 |
Test2 |
|
Lorsque j'utilise la fonction Find
Le champ donnee2 contient "Test2" provient de l'onglet "Périmètre"
Code:
1 2 3 4
| donnee2 = Fe.Cells(Ligne, "B").Value
Set ca = Worksheets("SYNTHESE").Range("A2:B" & Tligne).Find(What:=donnee2, LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=True)
If Not ca Is Nothing Then
therow = ca.Row |
Le résultat au niveau du therow = 2 qui correspond à la 2 lignes de "SYNTHESE" et je veux therow = 3 en fonction de mon paramètre donnee1
question peux t'on ajouter un 2 critères dans un Find ou une autre solution pour régler mon problème?
Merci de votre collaboration pour résoudre mon problème.
Bien cordialement.
MamaB
[XL-2019] fonction Find dans Macros et VBA Excel
Bonjour,
Erreur dans le code fourni, voici la bonne version:
Code:
1 2 3 4 5
|
donnee2 = Fe.Cells(Ligne, "B").Value
Set ca = Worksheets("SYNTHESE").Range("B2:B" & Tligne).Find(What:=donnee2, LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=True)
If Not ca Is Nothing Then
therow = ca.Row |
[XL-2019] fonction Find dans Macros et VBA Excel
Merci Menhir
Cela fonction parfaitement.
Bien cordialement.
MamaB