Ceci est une page optimisée pour les mobiles. Cliquez sur ce texte pour afficher la vraie page.

XL 2019 Réunir du texte

  • Initiateur de la discussion Initiateur de la discussion lynyrd
  • Date de début Date de début

Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

lynyrd

XLDnaute Impliqué
Bonjour le forum
y a t'il un moyen (par VBA) d'avoir sur 1 ligne par No de ligne
- le texte en français
- le texte en englais
Merci.
 

Pièces jointes

C'est t'il faisable en VbA
Bien sûr, la macro dans le code de la feuille "Transpose" :
VB:
Private Sub Worksheet_Activate()
Dim tablo, resu, i&, n&
tablo = Sheets("Import").ListObjects(1).Range.Resize(, 4)
ReDim resu(1 To 1 + 4 * (UBound(tablo) - 1), 1 To 2)
For i = 2 To UBound(tablo)
    If Trim(CStr(tablo(i, 1))) <> "" Then
        n = n + 1
        resu(n, 1) = tablo(i, 1): n = n + 1
        resu(n, 1) = tablo(i, 2)
        resu(n, 2) = tablo(i, 2): n = n + 1
        resu(n, 1) = tablo(i, 4)
        n = n + 1
    End If
Next i
'---restitution---
Application.ScreenUpdating = False
Cells.Clear 'RAZ
On Error Resume Next 'si aucune SpecialCell
With [A2]
    If n Then .Resize(n, 2) = resu
    With Range(.Offset(-1), Me.UsedRange)
        .HorizontalAlignment = xlLeft
        .AutoFilter 1, "<1" 'filtre automatique
        With .SpecialCells(xlCellTypeVisible)
            .HorizontalAlignment = xlCenter
            .NumberFormat = "hh:mm:ss.000"
        End With
        .AutoFilter 'ôte le filtre
        .Columns(2).HorizontalAlignment = xlCenter
        .Columns(2).NumberFormat = "hh:mm:ss.000"
        .Rows(1).Delete xlUp
        .Columns.ColumnWidth = 12
    End With
End With
End Sub
Elle se déclenche quand on active la feuille.
 

Pièces jointes

Bonjour lynyrd, le forum,
VB:
Private Sub Worksheet_Activate()
Dim tablo, resu, i&, n&
tablo = Sheets("Import").ListObjects(1).Range.Resize(, 4)
ReDim resu(1 To 1 + 4 * (UBound(tablo) - 1), 1 To 3)
For i = 2 To UBound(tablo)
    If Trim(CStr(tablo(i, 1))) <> "" Then
        n = n + 2
        resu(n, 1) = tablo(i, 1): n = n + 1
        resu(n, 1) = tablo(i, 2)
        resu(n, 2) = "-->"
        resu(n, 3) = tablo(i, 3): n = n + 1
        resu(n, 1) = tablo(i, 4)
    End If
Next i
'---restitution---
Application.ScreenUpdating = False
Cells.Clear 'RAZ
On Error Resume Next 'si aucune SpecialCell
With [A1]
    If n Then .Resize(n, 3) = resu
    With Range(.Cells, Me.UsedRange)
        .HorizontalAlignment = xlLeft
        .AutoFilter 1, "<1" 'filtre automatique
        With .SpecialCells(xlCellTypeVisible)
            .HorizontalAlignment = xlCenter
            .NumberFormat = "hh:mm:ss.000"
        End With
        .AutoFilter 'ôte le filtre
        .Rows(1).Delete xlUp
        .Columns.ColumnWidth = 12
        .Columns(2).AutoFit
    End With
End With
End Sub
A+
 

Pièces jointes

Ceci est plus simple :
VB:
Private Sub Worksheet_Activate()
Dim tablo, resu, i&, n&
tablo = Sheets("Import").ListObjects(1).Range.Resize(, 4)
ReDim resu(1 To 1 + 4 * (UBound(tablo) - 1), 1 To 3)
For i = 2 To UBound(tablo)
    If Trim(CStr(tablo(i, 1))) <> "" Then
        n = n + 2
        resu(n, 1) = tablo(i, 1): n = n + 1
        resu(n, 1) = tablo(i, 2)
        resu(n, 2) = "-->"
        resu(n, 3) = tablo(i, 3): n = n + 1
        resu(n, 1) = tablo(i, 4)
    End If
Next i
'---restitution---
Application.ScreenUpdating = False
Cells.Clear 'RAZ
If n = 0 Then Exit Sub
With [A1]
    .Resize(n, 3) = resu
    With Range(.Cells, Me.UsedRange)
        .HorizontalAlignment = xlLeft
        .AutoFilter 1, "<1" 'filtre automatique
        With .SpecialCells(xlCellTypeVisible)
            .NumberFormat = "hh:mm:ss.000"
            .Columns.AutoFit 'ajustement largeurs
        End With
        .AutoFilter 'ôte le filtre
        .Rows(1).Delete xlUp
    End With
End With
End Sub
 

Pièces jointes

Dernière édition:
- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

Réponses
19
Affichages
472
Réponses
2
Affichages
124
Réponses
56
Affichages
2 K
Réponses
3
Affichages
85
Les cookies sont requis pour utiliser ce site. Vous devez les accepter pour continuer à utiliser le site. En savoir plus…