Sub coupe()
Dim Longueur As Long, Tourne As Long, Colonne As Long
Dim phrase As String
Colonne = 2
phrase = Range("A2")
Longueur = Len(phrase)
For Tourne = 1 To Longueur Step 255
Cells(2, Colonne) = Mid(phrase, Tourne, 255)
Colonne = Colonne + 1
Next Tourne
End Sub
Function hache(texte$, ParamArray coupure())
Const l% = 255
Dim i%, x%, y%, z%, v$()
ReDim v(0)
If UBound(coupure) < 0 Then coupure = Array(ChrW(&HFEFF))
Do While Len(texte) > l
z = 0
For i = 0 To UBound(coupure)
x = -(Left$(texte, 1) = coupure(i))
Do
y = x: x = x + 1: x = InStr(x, texte, coupure(i))
Loop Until x = 0 Or x > l
If y > z Then z = y: If z = l Then Exit For
Next
If z = 0 Then z = l
v(UBound(v)) = Mid$(texte, 1, z)
texte = Mid$(texte, z + 1, Len(texte))
ReDim Preserve v(UBound(v) + 1)
Loop
v(UBound(v)) = texte
hache = v
End Function
Sub saucissonne()
Dim i%, x
With Selection(1)
x = hache(.Text, " ", "-", Chr(10))
i = UBound(x) + 1
With Application: .ScreenUpdating = 0: .EnableEvents = 0: .Calculation = -4135: End With
With .Offset(0, 1)
.Resize(1, i).Value = x
Do Until .Offset(0, i).Text = "": .Offset(0, i).Value = "": i = i + 1: Loop
End With
With Application: .Calculation = -4105: .EnableEvents = 1: .ScreenUpdating = 1: End With
End With
End Sub
Sub massacre()
Dim i%, x
With Selection(1)
x = hache(.Text)
i = UBound(x) + 1
With Application: .ScreenUpdating = 0: .EnableEvents = 0: .Calculation = -4135: End With
With .Offset(0, 1)
.Resize(1, i).Value = x
Do Until .Offset(0, i).Text = "": .Offset(0, i).Value = "": i = i + 1: Loop
End With
With Application: .Calculation = -4105: .EnableEvents = 1: .ScreenUpdating = 1: End With
End With
End Sub