Bonjour,
Je tente de récupérer une adresse client avec la méthode Find.
Mon fichier est de la forme:
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 'Récupération du nom du client art = Sheets("Clients").Cells(MaLigne, 2) 'Récupération de la catégorie art2 = Sheets("Clients").Cells(MaLigne, 1) 'Champs Adresse Windows(Fichier_Client).Activate* 'On recherche la catégorie Set c = Worksheets("Art").Rows("1").Find(art2, LookIn:=xlValues) If Not c Is Nothing Then Com = c.Column 'MsgBox Split(Columns(Com).Address(ColumnAbsolute:=False), ":")(1) 'Ln = Worksheets("Art").Column(Com & Rows.Count).End(xlUp).Row + 1 'Une fois la catégorie trouvée, on recherche le client Set b = Worksheets("Art").Range(Cells(1, Com), Cells(7, Com)).Find(art, LookIn:=xlValues) If Not b Is Nothing Then coc = b.Row 'On copie l adresse Cells(coc, Com + 1).Copy End If End If
Pour l'intant, j'ai une erreur sur la ligne:
Erreur: Erreur d'exécution 1004: Erreur définie par l'application ou par l'objet
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 Set b = Worksheets("Art").Range(Cells(1, Com), Cells(7, Com)).Find(art, LookIn:=xlValues)
Je ne vois pas du tout ou ça bloque ...
Merci pour votre aide
Partager