1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
With WsSource
If .Cells(1, 1) = 1 Then .Rows(1).Delete
Nbl = .Range("A1").CurrentRegion.Rows.Count
Nbc = .Range("A1").CurrentRegion.Columns.Count
.Columns(1).Select
Selection.NumberFormat = "General"
.Columns(36).Select
Selection.NumberFormat = "General"
For i = 1 To Nbc
.Columns(i).Hidden = False
Next i
Set a = Nothing: Set a = .Rows(1).Find("Date d'effet", , xlValues, xlWhole)
Set b = Nothing: Set b = .Rows(1).Find("Date livraison souhaitée", , xlValues, xlWhole)
Set c = Nothing: Set c = .Rows(1).Find("Date de début du processus", , xlValues, xlWhole)
Set d = Nothing: Set d = .Rows(1).Find("Date d'envoi ", , xlValues, xlWhole)
For i = 2 To Nbl
.Cells(i, a.Column).NumberFormat = "General": .Cells(i, b.Column).NumberFormat = "General": .Cells(i, c.Column).NumberFormat = "General": .Cells(i, d.Column).NumberFormat = "General"
.Cells(i, a.Column).Value = Format(.Cells(i, a.Column).Value, "yyyy-mm-dd")
.Cells(i, b.Column).Value = Format(.Cells(i, b.Column).Value, "yyyy-mm-dd")
.Cells(i, c.Column).Value = Format(.Cells(i, c.Column).Value, "yyyy-mm-dd")
.Cells(i, d.Column).Value = Format(.Cells(i, d.Column).Value, "yyyy-mm-dd")
Next i
End With |
Partager