Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Transposer des valeurs de plusieurs colonnes vers plusieurs lignes

4 réponses
Avatar
Flag
Bonjour,

J'ai un fichier comme suit :

A B C D E F G H
Prénom Nom No Emp R1 R1 R3 R4 R4

Joe Bedon 2456 Ind1 Ind2 Ind1
Guy balou 0011 Ind1 Ind1 Ind1
Ind2
al Lele 1212 Ind1
Joe ball 1030 Ind1 Ind1

J'aimerais que LORSQU'IL Y A UNE VALEUR dans les cellules
D E F G H (dans mon fichier original ça va jusqu’à la colonne AC)que la
ligne soit transposée comme l’exemple ci-bas :
- Les colonnes A B C sont réinscrites.
- Dans la colonne D nous retrouvons le nom de ligne de titre
- Dans la colonne E la valeur qui a été transposée
Voici le fichier final :

A B C D E
Joe Bedon 2456 R1 Ind1
Joe Bedon 2456 R1 Ind2
Joe Bedon 2456 R3 Ind1
Guy balou 0011 R1 Ind1
Guy balou 0011 R3 Ind1
Guy balou 0011 R4 Ind1
Guy balou 0011 R4 Ind2
al Lele 1212 R4 Ind1
Joe ball 1030 R1 Ind1
Joe ball 1030 R3 Ind1

Comment je peux arriver à transformer ce fichier?
Merci beaucoup pour votre aide!
Flag99
Windows XP
Excel 2007 ou 2003
Utilisateur intermédiaire

4 réponses

Avatar
isabelle
bonjour Flag,

peut tu mettre ton fichier sur ci-joint,
http://www.cjoint.com ou http://www.cijoint.fr/
parce que ce n'est pas évident de visualiser les données dans le message,

isabelle

Le 2010-01-12 13:47, Flag a écrit :
Bonjour,

J'ai un fichier comme suit :

A B C D E F G H
Prénom Nom No Emp R1 R1 R3 R4 R4

Joe Bedon 2456 Ind1 Ind2 Ind1
Guy balou 0011 Ind1 Ind1 Ind1
Ind2
al Lele 1212 Ind1
Joe ball 1030 Ind1 Ind1

J'aimerais que LORSQU'IL Y A UNE VALEUR dans les cellules
D E F G H (dans mon fichier original ça va jusqu’à la colonne AC)que la
ligne soit transposée comme l’exemple ci-bas :
- Les colonnes A B C sont réinscrites.
- Dans la colonne D nous retrouvons le nom de ligne de titre
- Dans la colonne E la valeur qui a été transposée
Voici le fichier final :

A B C D E
Joe Bedon 2456 R1 Ind1
Joe Bedon 2456 R1 Ind2
Joe Bedon 2456 R3 Ind1
Guy balou 0011 R1 Ind1
Guy balou 0011 R3 Ind1
Guy balou 0011 R4 Ind1
Guy balou 0011 R4 Ind2
al Lele 1212 R4 Ind1
Joe ball 1030 R1 Ind1
Joe ball 1030 R3 Ind1

Comment je peux arriver à transformer ce fichier?
Merci beaucoup pour votre aide!
Flag99
Windows XP
Excel 2007 ou 2003
Utilisateur intermédiaire




Avatar
Flag
Bonjour,
J'ai déposé le fichier tel que demandé.

http://www.cijoint.fr/cjlink.php?file=cj201001/cijQCpHDq1.xls

Merci encore pour votre aide!



Le dépôt du fichier Transposer.xls a été réalisé avec succès !
Veuillez noter le lien ci-dessous qui vous permettra d'accéder à ce fichier.
C'est ce même lien que vous devrez transmettre à vos correspondants
http://www.cijoint.fr/cjlink.php?file=cj201001/cijQCpHDq1.xls


--
Flag99
Excel 2007 ou 2003
Windows CP



"isabelle" wrote:

bonjour Flag,

peut tu mettre ton fichier sur ci-joint,
http://www.cjoint.com ou http://www.cijoint.fr/
parce que ce n'est pas évident de visualiser les données dans le message,

isabelle

Le 2010-01-12 13:47, Flag a écrit :
> Bonjour,
>
> J'ai un fichier comme suit :
>
> A B C D E F G H
> Prénom Nom No Emp R1 R1 R3 R4 R4
>
> Joe Bedon 2456 Ind1 Ind2 Ind1
> Guy balou 0011 Ind1 Ind1 Ind1
> Ind2
> al Lele 1212 Ind1
> Joe ball 1030 Ind1 Ind1
>
> J'aimerais que LORSQU'IL Y A UNE VALEUR dans les cellules
> D E F G H (dans mon fichier original ça va jusqu’à la colonne AC)que la
> ligne soit transposée comme l’exemple ci-bas :
> - Les colonnes A B C sont réinscrites.
> - Dans la colonne D nous retrouvons le nom de ligne de titre
> - Dans la colonne E la valeur qui a été transposée
> Voici le fichier final :
>
> A B C D E
> Joe Bedon 2456 R1 Ind1
> Joe Bedon 2456 R1 Ind2
> Joe Bedon 2456 R3 Ind1
> Guy balou 0011 R1 Ind1
> Guy balou 0011 R3 Ind1
> Guy balou 0011 R4 Ind1
> Guy balou 0011 R4 Ind2
> al Lele 1212 R4 Ind1
> Joe ball 1030 R1 Ind1
> Joe ball 1030 R3 Ind1
>
> Comment je peux arriver à transformer ce fichier?
> Merci beaucoup pour votre aide!
> Flag99
> Windows XP
> Excel 2007 ou 2003
> Utilisateur intermédiaire
>
>
.



Avatar
isabelle
bonjour Flag,

j'ai supposé que la ligne de titre est sur la ligne 4 sur ton fichier
original
si ce n'est pas le cas il faudra adapter
est ce que tu voudrait essayer celle-ci,

Sub Macro2()
a = Sheets("Feuil1").Range("A65536").End(xlUp).Row
b = Sheets("Feuil1").Range("IV4").End(xlToLeft).Column
For i = 5 To a
For y = 4 To b
If Sheets("Feuil1").Cells(i, y) <> "" Then
With Sheets("Feuil2")
x = x + 1
.Range("A" & x) = Sheets("Feuil1").Cells(i, 1)
.Range("B" & x) = Sheets("Feuil1").Cells(i, 2)
.Range("C" & x) = Sheets("Feuil1").Cells(i, 3)
.Range("D" & x) = Sheets("Feuil1").Cells(4, y)
.Range("E" & x) = Sheets("Feuil1").Cells(i, y)
End With
End If
Next
Next
End Sub

isabelle

Le 2010-01-13 09:08, Flag a écrit :
Bonjour,
J'ai déposé le fichier tel que demandé.

http://www.cijoint.fr/cjlink.php?file=cj201001/cijQCpHDq1.xls

Merci encore pour votre aide!



Le dépôt du fichier Transposer.xls a été réalisé avec succès !
Veuillez noter le lien ci-dessous qui vous permettra d'accéder à ce fichier.
C'est ce même lien que vous devrez transmettre à vos correspondants
http://www.cijoint.fr/cjlink.php?file=cj201001/cijQCpHDq1.xls





Avatar
Flag
Bonjour Isabelle,

Tout fonctionne.

Merci pour ton aide!
--
Flag
Excel 2002
Windows 2000



"isabelle" wrote:

bonjour Flag,

j'ai supposé que la ligne de titre est sur la ligne 4 sur ton fichier
original
si ce n'est pas le cas il faudra adapter
est ce que tu voudrait essayer celle-ci,

Sub Macro2()
a = Sheets("Feuil1").Range("A65536").End(xlUp).Row
b = Sheets("Feuil1").Range("IV4").End(xlToLeft).Column
For i = 5 To a
For y = 4 To b
If Sheets("Feuil1").Cells(i, y) <> "" Then
With Sheets("Feuil2")
x = x + 1
.Range("A" & x) = Sheets("Feuil1").Cells(i, 1)
.Range("B" & x) = Sheets("Feuil1").Cells(i, 2)
.Range("C" & x) = Sheets("Feuil1").Cells(i, 3)
.Range("D" & x) = Sheets("Feuil1").Cells(4, y)
.Range("E" & x) = Sheets("Feuil1").Cells(i, y)
End With
End If
Next
Next
End Sub

isabelle

Le 2010-01-13 09:08, Flag a écrit :
> Bonjour,
> J'ai déposé le fichier tel que demandé.
>
> http://www.cijoint.fr/cjlink.php?file=cj201001/cijQCpHDq1.xls
>
> Merci encore pour votre aide!
>
>
>
> Le dépôt du fichier Transposer.xls a été réalisé avec succès !
> Veuillez noter le lien ci-dessous qui vous permettra d'accéder à ce fichier.
> C'est ce même lien que vous devrez transmettre à vos correspondants
> http://www.cijoint.fr/cjlink.php?file=cj201001/cijQCpHDq1.xls
>
>
>
.