Bonjour,

J'essaie de mettre mes dates au format international en procédant comme suit :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
 
 
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).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

Mais ça ne fonctionne pas

je n'ai aucune erreur mais toutes les cellules ne changent pas de format alors que manuellement le format change, pourrais je avoir de l'aide svp ?

Cordialement