1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| Sub ()
'
Dim MaPlage As Range
Dim Cel As Range
Dim MaVal As String 'Pour définir la variable avec la valeur à retourner
Dim MaLong As Integer 'Pour définir la variable de la longueur initiale
Dim NbBlanc As Integer 'Pour définir le nombre d'espace à mettre
Dim i As Integer 'Pour la boucle
Set MaPlage = Range(Cells(2, 19), Cells(Cells(Range("s:s").Rows.Count, 2).End(xlUp).Row, 2))
For Each Cel In MaPlage
MaVal = Cel.Value
MaLong = Len(Cel.Value)
NbBlanc = 300 - MaLong
For i = 1 To NbBlanc
MaVal = MaVal & " "
Next i
Cel.Value = MaVal
Next Cel
End Sub |
Partager