Transposé une colonne

maval

XLDnaute Barbatruc
Bonjour,

J'ai une colonne "A" avec des noms de ville j'aimerai si possible les transposés en colonne "D" avec des d'autre caractères mon fichier seras plus explicite

Je vous remercie d'avance

Cordialement

Max
 

Pièces jointes

  • transpose.xlsm
    16 KB · Affichages: 20

natorp

XLDnaute Accro
Bjr Max

Pas compris quel est le besoin, une copie de la colonne A avec le lien vers le site de la commune concernée ?
Plutôt que du code, pourrais-tu mettre en colonne D ce que tu souhaites obtenir ?

Cordialement, Gérard
 

natorp

XLDnaute Accro
Avec ces codes après avoir sélectionné la ligne concernée

Code:
Sub AjouterGauche()
Dim c As Range
For Each c In Selection
If c.Value <> "" Then c.Value = "Communes/" & c.Value
Next
End Sub

Sub AjouterDroite()
Dim c As Range
For Each c In Selection
If c.Value <> "" Then c.Value = c.Value & ".html"
Next
End Sub

Cordialement, Gérard
 

maval

XLDnaute Barbatruc
Re,

Non pour le code transpose je l'es trouver
Code:
Sub Concat()
Dim Cel As Range
        Application.ScreenUpdating = False
    For Each Cel In Range("a6:a" & [a65000].End(xlUp).Row)
  
         Cells(6, "d") = Trim(Cells(6, "d")) & "  " & Cel
    Next Cel
End Sub

a ce code il faut que j'arrive a lui ajouter en début "var txt = new Array ('AAST ',' ABANCOURT ', ect...
 

natorp

XLDnaute Accro
Comme ça ?

Code:
Sub Concat()
Dim Cel As Range
         Application.ScreenUpdating = False
     For Each Cel In Range("a6:a" & [a65000].End(xlUp).Row)
  
          Cells(5, "d") = Trim(Cells(5, "d")) & "','" & Cel
    Next Cel
        Cells(5, "d").Value = Mid(Cells(5, "d").Value, 2)
        Cells(5, "d").Value = "var txt = new Array ('" & Cells(5, "d").Value & "')"
End Sub

Cordialement, Gérard
 

maval

XLDnaute Barbatruc
Oui
la première partie est nickel je te remercie beaucoup
sur le même style la deuxième partie se compose comme ceci

var url = new Array ('Afrique/Afrique_du_Sud.html','Afrique/Algerie.html','Afrique/Angola.html','Afrique/Benin.html','Afrique/Botswana.html','Afrique/Burkina_Faso.html','Afrique/Burundi.html','Afrique/Cameroun.html','Afrique/Cap_Vert.html','Afrique/Comores.html','Afrique/Congo.html','Afrique/Côte_d_Ivoire.html','Afrique/Djibouti.html','Afrique/Egypte.html','Afrique/Erythree.html','Afrique/Ethiopie.html','Afrique/Republique_Centrafricaine.html','Afrique/Republique_Democratique_du_Congo.html','Afrique/Rwanda.html','Afrique/São_Tome_et_Príncipe.html','Afrique/Senegal.html','Afrique/Seychelles.html','Afrique/Sierra_Leone.html','Afrique/Somalie.html','Afrique/Soudan.html','Afrique/Swaziland.html','Afrique/Tanzanie.html','Afrique/Tchad.html','Afrique/Togo.html','Afrique/Tunisie.html','Afrique/Zambie.html','Afrique/Zimbabwe.html');

Toujors sur une cellule "D7"

@+

Max
 

Discussions similaires

Réponses
3
Affichages
248
Réponses
4
Affichages
250

Statistiques des forums

Discussions
313 344
Messages
2 097 337
Membres
106 916
dernier inscrit
Soltani mohamed