Note: The other languages of the website are Google-translated. Back to English
Se connecter  \/ 
x
or
x
INSCRIPTION  \/ 
x

or

Comment transposer / convertir des colonnes et des lignes en une seule colonne?

Lorsque vous utilisez une feuille de calcul Excel, vous rencontrez parfois ce problème: comment pouvez-vous convertir ou transposer une plage de données en une seule colonne? (Voir les captures d'écran suivantes :) Maintenant, je vous présente trois astuces rapides pour résoudre ce problème.

Transposer / convertir des colonnes et des lignes en une seule colonne avec une formule

Transposer / Convertir les colonnes et les lignes en une seule colonne avec le code VBA

Transposer / Convertir des colonnes et des lignes en une seule colonne avec Kutools for Excelbonne idée3


Transposer / convertir des colonnes et des lignes en une seule colonne avec une formule

La formule longue suivante peut vous aider à transposer rapidement une plage de données dans une colonne, procédez comme suit:

1. Tout d'abord, définissez un nom de plage pour votre plage de données, sélectionnez les données de plage que vous souhaitez convertir, faites un clic droit et choisissez Définir le nom forment le menu contextuel. dans le Nouveau nom boîte de dialogue, entrez le nom de plage souhaité. Puis clique OK. Voir la capture d'écran:

2. Après avoir spécifié le nom de la plage, cliquez sur une cellule vide, dans cet exemple, je clique sur la cellule E1, puis je saisis cette formule: =INDEX(MyData,1+INT((ROW(A1)-1)/COLUMNS(MyData)),MOD(ROW(A1)-1+COLUMNS(MyData),COLUMNS(MyData))+1).

Notes: Mes données est le nom de plage des données sélectionnées, vous pouvez le modifier selon vos besoins.

3. Faites ensuite glisser la formule vers la cellule jusqu'à ce que les informations d'erreur s'affichent. Toutes les données de la plage ont été transposées dans une seule colonne. Voir la capture d'écran:


Transposer rapidement la plage dans une colonne / ligne / ou vice versa dans Excel

Dans certains cas, vous devrez peut-être transposer une plage de cellules en une colonne ou une ligne, ou vice versa, convertir une colonne ou une ligne en plusieurs lignes et colonnes dans une feuille Excel. Avez-vous un moyen rapide de le résoudre? Ici le Transposer la gamme fonctionner dans Kutools pour Excel peut gérer facilement tous les travaux ci-dessus.Cliquez pour un essai gratuit complet en 30 jours!
doc1
 
Kutools for Excel: avec plus de 300 compléments Excel pratiques, essayez gratuitement sans limitation en 30 jours.

Transposer / Convertir les colonnes et les lignes en une seule colonne avec le code VBA

Avec le code VBA suivant, vous pouvez également joindre les multiples colonnes et lignes en une seule colonne.

1. Maintenez le ALT + F11 clés pour ouvrir le Microsoft Visual Basic pour applications fenêtre.

2. Cliquez insérer > Moduleet collez le code suivant dans le Module fenêtre.

Sub ConvertRangeToColumn()
'Updateby20131126
Dim Range1 As Range, Range2 As Range, Rng As Range
Dim rowIndex As Integer
xTitleId = "KutoolsforExcel"
Set Range1 = Application.Selection
Set Range1 = Application.InputBox("Source Ranges:", xTitleId, Range1.Address, Type:=8)
Set Range2 = Application.InputBox("Convert to (single cell):", xTitleId, Type:=8)
rowIndex = 0
Application.ScreenUpdating = False
For Each Rng In Range1.Rows
    Rng.Copy
    Range2.Offset(rowIndex, 0).PasteSpecial Paste:=xlPasteAll, Transpose:=True
    rowIndex = rowIndex + Rng.Columns.Count
Next
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub

3. presse F5 pour exécuter le code, et une boîte de dialogue s'affiche pour vous permettre de sélectionner une plage à convertir. Voir la capture d'écran:

4. Puis clique Ok, et une autre boîte de dialogue s'affiche pour sélectionner une cellule unique pour afficher le résultat, voir capture d'écran:

5. Et cliquez sur Ok, puis le contenu de la cellule de la plage est converti en une liste d'une colonne, voir capture d'écran:

doc-convertir-plage-en-colonne11


Transposer / Convertir des colonnes et des lignes en une seule colonne avec Kutools for Excel

Peut-être que la formule est trop longue à retenir et que le code VBA a des limites pour vous, dans cette situation, ne vous inquiétez pas, ici je vais vous présenter un outil plus simple et plus multifonctionnel-Kutools pour Excel, Avec son Transform Range utilitaire, et vous pouvez résoudre ce problème rapidement et facilement.

Kutools pour Excel, avec plus de 300 fonctions pratiques, rend vos travaux plus faciles. 

Après installation gratuite Kutools for Excel, procédez comme suit:

1. Sélectionnez la plage à transposer.

2. Cliquez Kutools > Transform Range, voir capture d'écran:

doc convertir la plage en colonne 12

3. dans le Transform Range boîte de dialogue, sélectionnez Range to single column option, voir capture d'écran:

doc convertir la plage en colonne 13

4. Puis clique OK, et spécifiez une cellule pour mettre le résultat de la zone contextuelle.

doc convertir la plage en colonne 14

5. Cliquez OKet les données de plusieurs colonnes et lignes ont été transposées en une seule colonne.
doc convertir la plage en colonne 15

Si vous souhaitez convertir une colonne en une plage avec des lignes fixes, vous pouvez également utiliser le Transform Range fonction pour le gérer rapidement.
doc convertir la plage en colonne 16


Transposer le tableau croisé en tableau de liste avec Kutools for Excel

Si vous avez un tableau croisé devant être converti en un tableau de liste comme ci-dessous la capture d'écran, sauf en retapant les données une par une, vous pouvez également utiliser Kutools pour Excel's Transpose Table Dimensions utilitaire pour convertir rapidement entre tableau croisé et liste dans Excel.
doc convertir la plage en colonne 19

Après installation gratuite Kutools for Excel, procédez comme suit:

1. Sélectionnez le tableau croisé que vous souhaitez convertir en liste, cliquez sur Kutools > Range > Transpose Table Dimensions.
doc convertir la plage en colonne 18

2. dans Transpose Table Dimension boîte de dialogue, vérifier Cross table to list option sur Transpose type section, sélectionnez une cellule pour placer le nouveau tableau de format.
doc convertir la plage en colonne 18

3. Cliquez Ok, maintenant le tableau croisé a été converti en liste.


Articles connexes:

Comment changer de ligne en colonne dans Excel?

Comment transposer / convertir une seule colonne en plusieurs colonnes dans Excel?

Comment transposer / convertir des colonnes et des lignes en une seule ligne?


Les meilleurs outils de productivité de bureau

Kutools for Excel résout la plupart de vos problèmes et augmente votre productivité de 80%

  • Réutilisation: Insérer rapidement formules complexes, graphiques et tout ce que vous avez utilisé auparavant; Crypter les cellules avec mot de passe; Créer une liste de diffusion et envoyer des e-mails ...
  • Barre Super Formula (modifiez facilement plusieurs lignes de texte et de formule); Disposition de lecture (lire et modifier facilement un grand nombre de cellules); Coller dans la plage filtrée...
  • Fusionner les cellules / lignes / colonnes sans perdre de données; Contenu des cellules divisées; Combiner des lignes / colonnes en double... Empêcher les cellules en double; Comparer les gammes...
  • Sélectionnez Dupliquer ou Unique Lignes; Sélectionnez les lignes vides (toutes les cellules sont vides); Super Find et Fuzzy Find dans de nombreux classeurs; Sélection aléatoire ...
  • Copie exacte Plusieurs cellules sans changer la référence de formule; Créer automatiquement des références à plusieurs feuilles; Insérer des puces, Cases à cocher et plus encore ...
  • Extrait du texte, Ajouter du texte, Supprimer par position, Supprimer l'espace; Créer et imprimer des sous-totaux de pagination; Conversion entre le contenu et les commentaires des cellules...
  • Super filtre (enregistrer et appliquer des schémas de filtrage à d'autres feuilles); Tri avancé par mois / semaine / jour, fréquence et plus; Filtre spécial par gras, italique ...
  • Combiner des classeurs et des feuilles de travail; Fusionner les tableaux en fonction des colonnes clés; Diviser les données en plusieurs feuilles; Conversion par lots xls, xlsx et PDF...
  • Plus de 300 fonctionnalités puissantes. Prend en charge Office / Excel 2007-2019 et 365. Prend en charge toutes les langues. Déploiement facile dans votre entreprise ou organisation. Essai gratuit de 30 jours. Garantie de remboursement de 60 jours.
onglet kte 201905

Office Tab apporte une interface à onglets à Office et simplifie considérablement votre travail

  • Activer l'édition et la lecture par onglets dans Word, Excel, PowerPoint, Publisher, Access, Visio et Project.
  • Ouvrez et créez plusieurs documents dans de nouveaux onglets de la même fenêtre, plutôt que dans de nouvelles fenêtres.
  • Augmente votre productivité de 50% et réduit des centaines de clics de souris chaque jour!
bas de cabine
Say something here...
symbols left.
You are guest
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Ng · 2 months ago
    Thank you so much! :)
  • To post as a guest, your comment is unpublished.
    sai · 1 years ago
    the data i am transposing to single column from rows have blanks in it how can i ignore them while transposing
    • To post as a guest, your comment is unpublished.
      Sunny · 1 years ago
      Hi, sai, you can transpose them to single column firstly, then remove the blank rows. How to remove blank rows, you can go to this article, it introduces 4 ways to remove blank rows, there must be one method can help you. https://www.extendoffice.com/documents/excel/525-excel-remove-blank-rows.html
  • To post as a guest, your comment is unpublished.
    Dana · 2 years ago
    thanks a lot; beautifull :-)
  • To post as a guest, your comment is unpublished.
    Philippe · 3 years ago
    Worked like a charm. Thanks a lot
  • To post as a guest, your comment is unpublished.
    deep · 3 years ago
    thanxs you have reduced my too much time....wonderful
  • To post as a guest, your comment is unpublished.
    NL · 3 years ago
    What if the table you start with has a range of values that is different for each row? Example: Say the table doesn't have FF, KK and LL, how do you make a single column from that table without doing them above example by hand?
    • To post as a guest, your comment is unpublished.
      Sunny · 3 years ago
      Just try above methods, if they cannot work, please tell me and upload your data as a picture to give some details
  • To post as a guest, your comment is unpublished.
    YO · 3 years ago
    THAT'S AMAZING! THANKYOU
  • To post as a guest, your comment is unpublished.
    Mahesh Kumar · 3 years ago
    Hi Friend I/m also facing a problem in excel

    My data are column-wise

    3.26mm 3.05mm 3.10mm
    0.1285 0.1200 0.1220
    1/4 1/4 6mm
    1-1/8 1-1/8 28mm
    2-5/8 2-5/8 66mm


    I want to arrange all in a single column

    3.05mm
    0.1200
    1/4
    1-1/8
    2-5/8
    3.10mm
    0.1220
    6mm
    28mm
    66mm


    Kindly share me formula or valuable suggestion. It's urgent for me. Please help me on priority bases.
  • To post as a guest, your comment is unpublished.
    sANJANA SURESH · 3 years ago
    HI,
    This formula is not working for me. giving error.
    here is my data

    1 A
    2 B
    3 C
    4 D
    5 E
    6 F
    7 G
    8 H
    9 I
    10 J
    This needs to be converted to the below

    1
    2
    A
    B
    3
    4
    C
    D
    5
    6
    E
    F
    7
    8
    G
    H
    9
    10
    I
    J


    PLEASE HELP ME ASAP. ITS REALLY URGENT. THANK YOU
  • To post as a guest, your comment is unpublished.
    RIAZ · 4 years ago
    I want to convert multiple column into single row in sequene. for example
    jan feb march april may june

    I want in this way

    jan

    feb

    march

    april

    may

    please comment
    • To post as a guest, your comment is unpublished.
      Phillip Kruchten · 3 years ago
      Copy the data into memory, then use the Paste Special, Tranpose option, this will convert your row of data into a column of data.
  • To post as a guest, your comment is unpublished.
    bsac · 4 years ago
    This did not work for me because I have 98 columns and 230 rows of uneven data. That is ROW 1 may have only 3 entries (A1, B1 & C1). While, row 2 may have 5 entries (A1, B1, C1, D1, E1) etc....etc..... you get the gist over the huge table of 98 columns and 230 rows.
  • To post as a guest, your comment is unpublished.
    bob · 4 years ago
    This did not work for me because I have 98 columns and 230 rows of uneven data. That is ROW 1 may have only 3 entries (A1, B1 & C1). While, row 2 may have 5 entries (A1, B1, C1, D1, E1) etc....etc..... you get the gist over the huge table of 98 columns and 230 rows.


    The formula did not work. Any suggestions?
  • To post as a guest, your comment is unpublished.
    budi · 4 years ago
    Hi. . . I have multiple range with same dimension in each sheet of excel file.
    Is it possible to transform column row range into single column for each sheet all at once?
  • To post as a guest, your comment is unpublished.
    Pj · 4 years ago
    Hello all,

    Is there a way to transpose multiple columns into single column based on a primary key, without using kutools?

    Example: Left table should be converted into right table:
    Id A B C D ID Category
    1 0 3 1 0 1 B
    2 1 2 1 0 1 B
    3 0 0 1 2 1 B
    4 0 1 0 0 1 C
    5 2 0 0 1 2 A
    2 B
    2 B
    2 C
    3 C
    3 D
    3 D
    4 B
    5 A
    5 A
    5 D
  • To post as a guest, your comment is unpublished.
    Ric · 4 years ago
    To get from
    A1 B1 C1
    A2 B2 C2

    to

    A1
    A2
    B1
    B2
    C1
    C2

    Use:
    =INDEX(Range,MOD(ROW(A1)+ROWS(Range)+1,ROWS(Range)+1),1+INT(ROW(A1)/(ROWS(Range)+1)))

    Ric
    • To post as a guest, your comment is unpublished.
      Gershome · 4 years ago
      This formula is not working for me. giving error.
      here is my data

      A1 B1
      A2 B2
      A3 B3
      A4 B4
      A5 B5
      A6 B6

      This needs to be converted to the below

      A1
      A2
      A3
      A4
      A5
      A6
      B1
      B2
      B3
      B4
      B5
      B6


      Please help me
  • To post as a guest, your comment is unpublished.
    MICHAEL · 4 years ago
    Using formula with same data ends up showing AA in E1. Not sure why?

    =INDEX(MyData,1+INT((ROW(A1)-1)/COLUMNS(MyData)),MOD(ROW(A1)-1+COLUMNS(MyData),COLUMNS(MyData))+1)
  • To post as a guest, your comment is unpublished.
    Fritz · 4 years ago
    Awesome makro! I just have a "minor" problem. I get stuck with an error: "Overflow (Error 6)". I have a table with many empty cells but still 51 columns and 1561 rows. Did anybody already faced such dimensions and problems? I guess it's really just a technical limit that I'm breaching here.
    Thanks for any help
    BR
    Fritz
  • To post as a guest, your comment is unpublished.
    Ryan · 4 years ago
    Hey,

    I was wondering how to change the to use two absolute values for the cells. This script is great and I want to add it into a bigger macro that requires no user input.
    Set Range1 = Application.InputBox("Source Ranges:", xTitleId, Range1.Address, Type:=8)
    Set Range2 = Application.InputBox("Convert to (single cell):", xTitleId, Type:=8)

    These two ranges need to be changed, but having some trouble.
    I tried this but am getting overflow errors.
    Set Range1 = Range("O2:BA1000")
    Set Range2 = Range("N2")

    Any ideas?
  • To post as a guest, your comment is unpublished.
    Joel · 4 years ago
    Fantastic VBA for transforming columns and rows into a single sorted column. Just saved me a ton of time. Thanks!
  • To post as a guest, your comment is unpublished.
    Gopi · 5 years ago
    Amazing.. thanks a ton..
  • To post as a guest, your comment is unpublished.
    Srikanth · 5 years ago
    I have different rows and column with large data. example as

    Mon jan Feb
    Cat N S W E N S W E
    A 4 6 7 8 1 2 3 4
    B 1 2 3 4 4 3 2 1
    C 3 2 4 4 3 2 4 6

    Now i have 2 years data which needs to copy pasted. can we do it any formula to get the February month data under January month.
  • To post as a guest, your comment is unpublished.
    rojo · 5 years ago
    Thank you so much. Awesome job!
  • To post as a guest, your comment is unpublished.
    bbe · 5 years ago
    Thank you so much!! This saved me so much time and worked perfectly for combining multiple columns into a single column.
  • To post as a guest, your comment is unpublished.
    Ann Voltz · 5 years ago
    Anyone know how to convert the following: Keeping 1st 3 columns the same but moving the rest of the columns to one column with the data lined up with the correct row. FROM THIS-
    14.05.2016 14:35:02 c8k000001 CHO2A ALB2 SI-I LDL_C GLUC3
    14.05.2016 14:35:03 c8k000002 CDC05 CHO2A ALB2 SI-I LDL_C
    14.05.2016 14:18:15 c8k000003 CDC05 ALTL CHO2A ALB2 SI-I

    TO THIS -
    14.05.2016 14:35:02 c8k000001 CHO2A
    ALB2
    SI-I
    LDL_C
    GLUC3
    14.05.2016 14:35:03 c8k000002 CDC05
    CHO2A
    ALB2
    SI-I
    LDL_C
    14.05.2016 14:18:15 c8k000003 CDC05
    ALTL
    CHO2A
    ALB2
    SI-I
    Really looking forward to some help with this one. Thanks!
    • To post as a guest, your comment is unpublished.
      Chris · 4 years ago
      I need the same solution as Ann. Your help is much appreciated
  • To post as a guest, your comment is unpublished.
    pinokio · 5 years ago
    If you do this and you also have dates in column A and customers in column (B1;D1), how do you adjus these likewise, so you will get it in column D and E next to the values? This also means that you get one customer and one date 3 times afer each other (18/07/2016) AA (18/07/2016) BB etc.
  • To post as a guest, your comment is unpublished.
    thomas · 5 years ago
    In case column A defines the group, and the other cells are exactly like this. You still want to get everything in one cell (except column A) and you want to adjust cell A so it still continues displaying to which value the columns belong after this (which means for example that group 1 has to repeated 3 times. I hope it's clear, can anyone tell me how to do that please
  • To post as a guest, your comment is unpublished.
    Happy Data Girl · 5 years ago
    Transpose/Convert columns and rows into single column with VBA code:
    THIS WAS AWESOME!!!!!! I was able to merge some columns appropriately and preserve the cell formatting!!!! I have mixed formats within cells (italics, bold, regular etc.) using mostly text relating to species biological analyses, and trying to keep that formatting in excel to use for exports can be VERY difficult when merging or rearranging data. This worked flawlessly and quickly, I kept crashing my VBA for merging cells and preserving formatting because the amount of data within a cell got to be too much. THANK YOU to whoever put this out there!!!
    Best Wishes,
    Happy Data Girl
  • To post as a guest, your comment is unpublished.
    Lavi Shawn · 5 years ago
    pradeep.kumar@rsrit.com
    rash@svktechinc.com
    Akshit kumar7hAkshit kumarHi s to akshith@smtworks.com
    K. Sandeep Babu {KSB}7hK. Sandeep Babu {KSB} to sandeep.babu@stiorg.com
    Anup Kumar7hAnup Kumar s on basis to anup@r3tek.com
    harsha Hemanth6hharsha Hemanth s to hemanth@imbuesys.com
    sriram rao6hsriram raopls recuirnts to sriram@itcomnce.com
    Radha Reddy6hRadha Reddy s at radha@infogensoftware.com
    Raja sekhar Reddy6hRaja sekhar Reddy to raj@prospectinfosys.com


    This is my data and I need to separate email IDS. Please help how to do it.
  • To post as a guest, your comment is unpublished.
    Nathan · 5 years ago
    phewwwwww!!!!!

    after hours of researching on how to do this
    GREAT WORK and thanks a lot

    Kind regards
    Nathan
  • To post as a guest, your comment is unpublished.
    Karpagaraj · 5 years ago
    Thanks it was very much helpful.....
  • To post as a guest, your comment is unpublished.
    Ramu b · 5 years ago
    This formula works better when data is in square format,

    =INDEX(Range,MOD(ROW(B5)-1+COLUMNS(Range),COLUMNS(Range))+1,1+INT((ROW(B5)-1)/COLUMNS(Range)))

    but challenge is how to use this formula when data is odd & even Rows & columns and also Dynamic range (Rows or Columns) data.

    Eg: A1:A5,B1:B4,C1:C6 range of data
    • To post as a guest, your comment is unpublished.
      joel · 5 years ago
      yeah i agree, is this possible if the no. of rows in each column is uneven?
  • To post as a guest, your comment is unpublished.
    s.mojtaba · 5 years ago
    thanks.It was very good.
  • To post as a guest, your comment is unpublished.
    Henock · 5 years ago
    Thank you very much! It saved my time and it is effective!!!!!!
  • To post as a guest, your comment is unpublished.
    DJ · 5 years ago
    Hi guys, I also needed to see down-then-across (a1, a2, a3, b1, b2, b3 etc) instead of across-then-down but that can be done easily by switching the formula to:

    =INDEX(Range,MOD(ROW(B5)-1+COLUMNS(Range),COLUMNS(Range))+1,1+INT((ROW(B5)-1)/COLUMNS(Range)))

    Note how the original formula was:

    =INDEX(Range,1+INT((ROW(A1)-1)/COLUMNS(Range)),MOD(ROW(A1)-1+COLUMNS(Range),COLUMNS(Range))+1)

    So this was simply a matter of switching parts before and after the comma. Thanks for this thread, helped a lot!
  • To post as a guest, your comment is unpublished.
    Dave · 6 years ago
    This was a HUGE help!! Thank you so much for posting!!
  • To post as a guest, your comment is unpublished.
    Jowjow · 6 years ago
    Very helpful! Thanks!
  • To post as a guest, your comment is unpublished.
    VCR · 6 years ago
    AMAZING! Thank you for posting for the world to benefit from your knowledge!
  • To post as a guest, your comment is unpublished.
    Ari · 6 years ago
    The order shown is across-then-down (A1, B1, C1, A2, B2, C2 ...) . I need down-then-across (A1, A2, A3, B1, B2, B3, ...). Is there a way to do that?
  • To post as a guest, your comment is unpublished.
    Poshiya Nikunj · 6 years ago
    Now I Feel Great........

    You Save My 30 Hours Of Work.....

    Excellent Work.
  • To post as a guest, your comment is unpublished.
    newb · 6 years ago
    thank you:) but how to less 0 value or null on the table or on the name of a range?
  • To post as a guest, your comment is unpublished.
    wil · 6 years ago
    Your indexing formula was exactly what i needed. Only note is that when copied, there is a "." at the end and Excel doesn't like that. Minor issue.
  • To post as a guest, your comment is unpublished.
    Parisa · 7 years ago
    Thank you very much.
  • To post as a guest, your comment is unpublished.
    steve trifelos · 7 years ago
    I'm using the .xls formula to convert a range of data into one column. I have input the formula as specified with my range name, but I am not clear on 'drag the formula to the cell until the error message appears'. I can't drag the formula anywhere from the formula bar. I'm sure it is user error but can you please help? Thanks
  • To post as a guest, your comment is unpublished.
    Phildobya · 7 years ago
    Full formula is =INDEX(Range,1+INT((ROW(A1)-1)/COLUMNS(Range)),MOD(ROW(A1)-1+COLUMNS(Range),COLUMNS(Range))+1)
    • To post as a guest, your comment is unpublished.
      steve trifelos · 7 years ago
      how did you 'drag the formula to the cell'? I can't drag it from the formula bar.
  • To post as a guest, your comment is unpublished.
    Chris · 7 years ago
    Is there a way to do this but when it grabs the range, it starts from A1 and does all of column A downward, and then grabs Column B and etc?
  • To post as a guest, your comment is unpublished.
    Muz · 7 years ago
    NICE! Thanks so much! Saved me tons of time!
  • To post as a guest, your comment is unpublished.
    Jow · 8 years ago
    Would have been nice to see the full equation in #2.