1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| Sub Conv()
Dim LastLig As Long
With ActiveCell
Cells(1, .Column).Value = "P"
Cells(1, .Column + 1).Value = "A"
Cells(1, .Column + 2).Value = "Ph"
Cells(1, .Column + 3).Value = "Code"
LastLig = Cells(Rows.Count, ActiveCell.Column).End(xlUp).Row
Range(Cells(.Row, .Column), Cells(LastLig, .Column)).Copy
Range(Cells(.Row, .Column + 3), Cells(LastLig, .Column + 3)).PasteSpecial xlPasteAll
Range(Cells(.Row, .Column), Cells(LastLig, .Column)).TextToColumns Destination:=Cells(.Row, .Column), _
DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 1), Array(3, 1), Array(6, 1)), TrailingMinusNumbers:=True
Cells(.Row, .Column).Select
End With
End Sub |
Partager