|
Publicité | ||||||||||||||||||||||
|
|
#1 (permalink) |
|
Débutant(e)
|
![]() Dans une colonnes, j'ai des cellules au fomat date. Sauf que suite a des erreurs de saisi, j'ai certaines date au bon format : jj/mm/aaaa et d'autre avec un mauvais format "jj.mm.aaaa". Dans ce derniercas, les cellules ne sont donc pas reconues en tant que date et sa me pose un gros probléme Je voudrais donc savoir comment faire pour remplcer les "." par des "/" et que se soit donc reconnu comme date. Merci |
|
|
|
|
|
#4 (permalink) |
|
Membre Expert
![]() Date d'inscription: décembre 2002
Localisation: 38
Âge: 20
Messages: 1 150
|
re je suppose la colonne A a adapter a ta colonne
Code :
Sub essai() Dim i As Long Application.ScreenUpdating = False For i = 1 To Range("A65535").End(xlUp).Row Cells(i, 1) = Replace(Cells(i, 1), ".", "/") Next i End Sub
__________________
SALUTATIONS
|
|
|
|
|
|
#6 (permalink) |
|
Membre Expert
![]() Date d'inscription: décembre 2002
Localisation: 38
Âge: 20
Messages: 1 150
|
re, teste comme cela pour voir !!!
Code :
Sub essai1() Dim i As Long Application.ScreenUpdating = False For i = 1 To Range("A65535").End(xlUp).Row If Cells(i, 1) Like "##.##/####" Or Cells(i, 1) Like "##/##.####" Or Cells(i, 1) Like "##.##.####" Then Cells(i, 1).NumberFormat = "@": Cells(i, 1) = Replace(Cells(i, 1), ".", "/"): Cells(i, 1).NumberFormat = "m/d/yyyy" End If: Next i End Sub
__________________
SALUTATIONS
|
|
|
|
|
|
![]() |
||
[XL-2003] Modifier un caractère dans une cellule
|
||
| Outils de la discussion | |
|
|