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
| Sub test()
Dim rg As Range, rg2 As Range, sh As Worksheet, t()
Dim i&, j&
Set sh = Sheets("RECUP")
Set rg = sh.Range(Cells(1, 5), Cells(1, 5).End(xlDown)).Rows.Count
Set rg2 = sh.Range(Cells(1, 125), Cells(1, 125).End(xlDown)).Rows.Count
t = rg
For i = rg To rg2
MsgBox i
For j = 1 To rg.Columns.Count
t(i, j) = TrouveType(t(i, j))
Next j
Next i
rg = t
fin:
Set rg = Nothing
Set sh = Nothing
MsgBox "FIN"
End Sub
Function TrouveType(V)
TrouveType = V
If IsDate(TrouveType) = True And InStr(TrouveType, "/") <> 0 And InStr(TrouveType, ":") <> 0 Then TrouveType = Format(TrouveType, "yyyy-mm-dd hh:mm"): Exit Function
If IsDate(TrouveType) = True And InStr(TrouveType, "/") <> 0 Then TrouveType = Format(TrouveType, "yyyy-mm-dd"): Exit Function
If IsNumeric(Replace(TrouveType, ".", ",")) = True Then TrouveType = Replace(TrouveType, ",", "."): Exit Function
End Function |
Partager