kiki29 | Re,pas aussi simple qu'il y parait, c'est de la "bidouille" mais à priori cela "marche"
Sub Tst2()
Dim i As Long
Dim v As Double
Dim j As Integer, m As Integer, a As Integer
Dim sJ As String, sM As String
Dim s As String
For i = 5 To 2000
If IsDate(Cells(i, 3)) Then
v = CDbl(CDate(Cells(i, 3)))
j = Day(v)
m = Month(v)
a = Year(v)
Select Case j
Case 1 To 9: sJ = "0" & j
Case Else: sJ = j
End Select
Select Case m
Case 1 To 9: sM = "0" & m
Case Else: sM = m
End Select
s = sJ & "/" & sM & "/" & a
Cells(i, 3).NumberFormat = "General"
Cells(i, 3) = Format(s, "dd/mm/yyyy" )
End If
Next i
End Sub
|
On doit pouvoir remplacer
Cells(i, 3).NumberFormat = "General"
Cells(i, 3) = Format(s, "dd/mm/yyyy" )
|
par
Cells(i, 3).NumberFormat = "General" Cells(i, 3) = CDate(s)
|
Message édité par kiki29 le 18-08-2009 à 17:13:36
|