Sub sup()
tablo = Split(Range("A7"), Chr(10))
'MsgBox tablo(0)
tablo(0) = Left(tablo(0), Len(tablo(0)) - 1)
'MsgBox tablo(0)
For i = UBound(tablo) To 0 Step -1
chaine = tablo(i) & Chr(10) & chaine
Next i
Range("A7") = chaine
End Sub
Sub sup()
tablo = Split(Range("A7"), Chr(10)) 'on sépare le texte de la cellule A7, avec retour chariot comme séparateur
tablo(0) = Trim(tablo(0)) 'on enlève les espaces dans le premier élément du tablo: donc ici.. "FRANCE " qui devien "FRANCE"
'et on reassemble la chaine en remettant des retours chariots
For i = UBound(tablo) To 0 Step -1
chaine = tablo(i) & Chr(10) & chaine
Next i
Range("A7") = chaine 'on réécrit la chaine
End Sub
Sub sup2()
tablo = Split(Range("A7"), Chr(10)) 'on sépare le texte de la cellule A7, avec retour chariot comme séparateur
For i = UBound(tablo) To 0 Step -1
chaine = Trim(tablo(i)) & Chr(10) & chaine
Next i
Range("A7") = chaine 'on réécrit la chaine
End Sub
Sub Bouton()
Dim str_temp As String
Dim tab_str_temp() As String
Dim iNbLigneDci As Integer
iNbLigneDci = Application.WorksheetFunction.CountA(Columns(2)) - 1
For i = 3 To iNbLigneDci + 3
str_temp = Cells(i, "R")
tab_str_temp = Split(str_temp, Chr(10))
For j = 0 To UBound(tab_str_temp)
chaine = Trim(tab_str_temp(j)) & Chr(10) & chaine
Next j
Next i
Cells(i, "R") = chaine 'on remet le resultat dans la cellule
End Sub
Sub Bouton()
Dim str_temp As String
Dim tab_str_temp() As String
Dim iNbLigneDci As Integer
'iNbLigneDci = Application.WorksheetFunction.CountA(Columns(2)) - 1
iNbLigneDci = Range("R" & Rows.Count).End(xlUp).Row - 2
For i = 3 To iNbLigneDci + 2
chaine = ""
tab_str_temp = Split(Cells(i, "R"), Chr(10))
For j = UBound(tab_str_temp) To 0 Step -1
chaine = Trim(tab_str_temp(j)) & Chr(10) & chaine
Next j
Cells(i, "R") = chaine 'la chaine se termine toujours par un retour chariot...
Next i
End Sub
Sub Bouton()
Dim str_temp As String
Dim tab_str_temp() As String
Dim iNbLigneDci As Integer
'iNbLigneDci = Application.WorksheetFunction.CountA(Columns(2)) - 1
iNbLigneDci = Range("R" & Rows.Count).End(xlUp).Row - 2
For i = 3 To iNbLigneDci + 2
chaine = ""
tab_str_temp = Split(Cells(i, "R"), Chr(10))
For j = UBound(tab_str_temp) To 0 Step -1
chaine = Trim(tab_str_temp(j)) & Chr(10) & chaine
Next j
Cells(i, "R") = Left(chaine, Len(chaine) - 1) 'on supprime le dernier retour chariot
Next i
End Sub
Sub Bouton()
Dim str_temp As String
Dim tab_str_temp() As String
Dim iNbLigneDci As Integer
iNbLigneDci = Range("R" & Rows.Count).End(xlUp).Row - 2
For i = 3 To iNbLigneDci + 2
chaine = ""
tab_str_temp = Split(Cells(i, "R"), Chr(10))
For j = UBound(tab_str_temp) To 0 Step -1
If tab_str_temp(j) <> "" Then chaine = Trim(tab_str_temp(j)) & Chr(10) & chaine
Next j
Cells(i, "R") = Left(chaine, Len(chaine) - 1) 'on supprime le dernier retour chariot
Next i
End Sub
Sub Bouton()
Dim str_temp As String
Dim tab_str_temp() As String
Dim iNbLigneDci As Integer
'iNbLigneDci = Application.WorksheetFunction.CountA(Columns(2)) - 1
iNbLigneDci = Range("R" & Rows.Count).End(xlUp).Row - 2
str_temp = Cells(i, "R")
For i = 3 To iNbLigneDci + 2
chaine = ""
tab_str_temp = Split(Cells(i, "R"), Chr(10))
For j = UBound(tab_str_temp) To 0 Step -1
chaine = Trim(tab_str_temp(j)) & Chr(10) & chaine
Next j
If str_temp = "" Then
i = i + 1
End If
Cells(i, "R") = Left(chaine, Len(chaine) - 1) 'on supprime le dernier retour chariot
Next i
End Sub