laucsap27
Messages postés1Date d'inscriptionmardi 23 août 2016StatutMembreDernière intervention23 août 2016
-
Modifié par laucsap27 le 23/08/2016 à 11:44
Eric4577
Messages postés2Date d'inscriptiondimanche 25 septembre 2016StatutMembreDernière intervention17 mai 2017
-
25 sept. 2016 à 12:28
Bonjour,
je débute en VBA pour excel 2010
pour cette première connexion sur le forum
je souhaiterai transposer des informations des colonnes A et B
en tableau, en fonction du contenu des cellules des colonnes
ça me semble encore compliqué mais je ne doute pas d'obtenir des solutions
sincères remerciements par avance.
ex:(situation synthétique des infos du fichiers actuel)
col A(nom) Col B(Critère x)
Arthur x1
Arthur x2
Arthur x3
Arthur x5
Arthur x7
Arthur x9
Raoul x2
Raoul x3
Chloé x1
Chloé x9
Chloé x11
12000 lignes à traiter 11 critères possibles
je souhaiterai
Transposées les noms et les critères correspondants en tableau de la manière suivante:
Nom Critères
Col C Col D Col E Col F Col G Col H Col I Col J Col K Col L Col M Col N
A x1 x2 x3 0 x5 0 x7 0 x9 0 0
B 0 x2 x3 0 0 0 0 0 0 0 0
C x1 0 0 0 0 0 0 0 x9 0 x11
For i = premlign To derlign With Worksheets("Feuil1").Range("C2:C65536") Set c = .Find(Range("A" & i), LookIn:=xlValues, Lookat:=xlWhole) If c Is Nothing Then If Range("C2") = "" Then Range("C2") = Range("A" & i) ligne = 2 Else Range("C" & Range("C1").End(xlDown).Row + 1) = Range("A" & i) ligne = Range("C1").End(xlDown).Row End If Else ligne = c.Row End If
Cells(ligne, CInt(Trim(Right(Range("B" & i), Len(Range("B" & i)) - 1))) + 3) = Range("B" & i) End With Next i
End Sub
J'ai gardé la première ligne pour :
nom, critère, nom,1,2,3,4,......11
et c'est pour la "Feuil1".
A toi d'adapter
Tu dis
Eric