Bonjour,
j'ai besoin de créer une macro (ou peut être plusieurs) pour chercher une valeur dans un tableau. Par exemple dans le Tableau 1 avec 3 colonnes (ID, Produit, Client)
Tableau 1
ID Produit Client
A0000001 Produit A Client 1
A0000002 Produit B Client 2
A0000003 Produit C Client 3
Je veux chercher le produit (Produit A, Produit B, Produit C) dans le Tableau 2 qui a 5 colonnes: Ressource (toto, tati), Produit (A,B,C), N° Etape (1,2,3), Nom Etape (Etape a, Etape b, Etape c), Heure (0, 50, 100...)
Tableau 2
Ressource Produit N° Etape Nom Etape Heures
Toto Produit A 1 Etape a 0
Toto Produit A 2 Etape b 100
Toto Produit A 3 Etape c 50
Toto Produit B 1 Etape a 100
Toto Produit B 2 Etape b 0
Toto Produit B 3 Etape c 50
Toto Produit C 1 Etape a 0
Toto Produit C 2 Etape b 0
Toto Produit C 3 Etape c 50
Tati Produit A 1 Etape a 100
Tati Produit A 2 Etape b 100
Tati Produit A 3 Etape c 50
Tati Produit B 1 Etape a 100
Tati Produit B 2 Etape b 0
Tati Produit B 3 Etape c 0
Tati Produit C 1 Etape a 50
Tati Produit C 2 Etape b 0
Tati Produit C 3 Etape c 0
Et qu'à chaque fois que je le trouve ET que la colonne "Heure" <>0 alors je duplique la ligne du Tableau 1 et je rajoute les colonnes trouvées dans le Tableau 2 pour obtenir le Tableau 3:
Tableau 3
ID Produit Client Ressource N° Etape Nom Etape Heures
A0000001 Produit A Client 1 Toto 2 Etape b 100
A0000001 Produit A Client 1 Toto 3 Etape c 50
A0000001 Produit A Client 1 Tati 1 Etape a 100
A0000001 Produit A Client 1 Tati 2 Etape b 100
A0000001 Produit A Client 1 Tati 3 Etape c 50
A0000002 Produit B Client 2 Toto 1 Etape a 100
A0000002 Produit B Client 2 Toto 3 Etape c 50
A0000002 Produit B Client 2 Tati 1 Etape a 100
A0000003 Produit C Client 3 Toto 3 Etape c 50
A0000003 Produit C Client 3 Tati 1 Etape a 50
J'ai tout essayé et je n'arrive pas
j'ai vraiment besoin de votre aide
Merci beaucoup 
Hello
je me suis dit qu'avec le fichier excel serait plus clair
Merci
Partager