Comment spliter une date dans différentes cellules excel vb6
kobejul08
Messages postés113Date d'inscriptionvendredi 15 avril 2005StatutMembreDernière intervention 3 octobre 2005
-
12 août 2005 à 15:55
jhary69
Messages postés81Date d'inscriptionjeudi 29 juillet 2004StatutMembreDernière intervention22 juillet 2007
-
13 août 2005 à 15:57
Bonjour,
comment le titre l'indique j'ai une date (10/01/2005) comme l'exemple si contre
je voudrais l'écrire dans trois cellule différentes .. comment dois je faire
je vous montre ce que j'ai codé et dites moi ou ça blesse Merci
Dim Jdate As Date
If monxl2.Cells(j, 3).Value = 1 Then
monxl2.Cells(j, 3) = "janvier"
End If
If monxl2.Cells(j, 3).Value = 2 Then
monxl2.Cells(j, 3) = "février"
End If
If monxl2.Cells(j, 3).Value = 3 Then
monxl2.Cells(j, 3) = "mars"
End If
If monxl2.Cells(j, 3).Value = 4 Then
monxl2.Cells(j, 3) = "avril"
End If
If monxl2.Cells(j, 3).Value = 5 Then
monxl2.Cells(j, 3) = "mai"
End If
If monxl2.Cells(j, 3).Value = 6 Then
monxl2.Cells(j, 3) = "juin"
End If
If monxl2.Cells(j, 3).Value = 7 Then
monxl2.Cells(j, 3) = "juillet"
End If
If monxl2.Cells(j, 3).Value = 8 Then
monxl2.Cells(j, 3) = "août"
End If
If monxl2.Cells(j, 3).Value = 9 Then
monxl2.Cells(j, 3) = "septembre"
End If
If monxl2.Cells(j, 3).Value = 10 Then
monxl2.Cells(j, 3) = "octobre"
End If
If monxl2.Cells(j, 3).Value = 11 Then
monxl2.Cells(j, 3) = "novembre"
End If
If monxl2.Cells(j, 3).Value = 12 Then
monxl2.Cells(j, 3) = "décembre"
End If
jhary69
Messages postés81Date d'inscriptionjeudi 29 juillet 2004StatutMembreDernière intervention22 juillet 2007 12 août 2005 à 16:07
salut,
monxl c'est une variable de type Sheet ?? si oui ok coté prog, si non Cells depend d'un objet Sheet ou Worksheet par directement du l'objet Workbook auquel cas
kobejul08
Messages postés113Date d'inscriptionvendredi 15 avril 2005StatutMembreDernière intervention 3 octobre 2005 12 août 2005 à 16:16
bon en fait je me rend compte que je fais des boulettes dans ce petit programme p-ê pourras tu m'aider
j'ai un fichier excel "EchantillonFichierCommandes.xls" c'est monxl2
et j'aimerais aller écrire dans monxl donc dans ce fichier qui s'appelle"NEW Commandes ericsson-nokia corrigé 09-08.xls"(monxl)
je veux juste recopier dans monxl ce qu'il ya dans monxl2
sauf que dans monxl2 j'ai une date en B2 ainsi 10/10/2005
et j'aimerais que dans monxl en B2 j'ai le jour donc 10
C2 j'ai le mois donc octobre
!!E2 j'ai l'année 2005
peux tu regarder mon prog. mais me dire ce qui ne va pas puisque il me demande meme pas si je veux enregistrer Merci.
If monxl2.Cells(j, 3).Value = 1 Then
monxl2.Cells(j, 3) = "janvier"
End If
If monxl2.Cells(j, 3).Value = 2 Then
monxl2.Cells(j, 3) = "février"
End If
If monxl2.Cells(j, 3).Value = 3 Then
monxl2.Cells(j, 3) = "mars"
End If
If monxl2.Cells(j, 3).Value = 4 Then
monxl2.Cells(j, 3) = "avril"
End If
If monxl2.Cells(j, 3).Value = 5 Then
monxl2.Cells(j, 3) = "mai"
End If
If monxl2.Cells(j, 3).Value = 6 Then
monxl2.Cells(j, 3) = "juin"
End If
If monxl2.Cells(j, 3).Value = 7 Then
monxl2.Cells(j, 3) = "juillet"
End If
If monxl2.Cells(j, 3).Value = 8 Then
monxl2.Cells(j, 3) = "août"
End If
If monxl2.Cells(j, 3).Value = 9 Then
monxl2.Cells(j, 3) = "septembre"
End If
If monxl2.Cells(j, 3).Value = 10 Then
monxl2.Cells(j, 3) = "octobre"
End If
If monxl2.Cells(j, 3).Value = 11 Then
monxl2.Cells(j, 3) = "novembre"
End If
If monxl2.Cells(j, 3).Value = 12 Then
monxl2.Cells(j, 3) = "décembre"
End If
If monxl2.Cells(j, 3).Value = 1 Then
monxl2.Cells(j, 3) = "janvier"
End If
If monxl2.Cells(j, 3).Value = 2 Then
monxl2.Cells(j, 3) = "février"
End If
If monxl2.Cells(j, 3).Value = 3 Then
monxl2.Cells(j, 3) = "mars"
End If
If monxl2.Cells(j, 3).Value = 4 Then
monxl2.Cells(j, 3) = "avril"
End If
If monxl2.Cells(j, 3).Value = 5 Then
monxl2.Cells(j, 3) = "mai"
End If
If monxl2.Cells(j, 3).Value = 6 Then
monxl2.Cells(j, 3) = "juin"
End If
If monxl2.Cells(j, 3).Value = 7 Then
monxl2.Cells(j, 3) = "juillet"
End If
If monxl2.Cells(j, 3).Value = 8 Then
monxl2.Cells(j, 3) = "août"
End If
If monxl2.Cells(j, 3).Value = 9 Then
monxl2.Cells(j, 3) = "septembre"
End If
If monxl2.Cells(j, 3).Value = 10 Then
monxl2.Cells(j, 3) = "octobre"
End If
If monxl2.Cells(j, 3).Value = 11 Then
monxl2.Cells(j, 3) = "novembre"
End If
If monxl2.Cells(j, 3).Value = 12 Then
monxl2.Cells(j, 3) = "décembre"
End If
a remplacer par
monxl.Cells(i, 2).Value = format(monxl2.Cells(j, 2),"dd")
monxl.Cells(i, 3).Value = format(monxl2.Cells(j, 3),"mmmm") ' ca te donne directement Janvier, Fevrier, ...
monxl.Cells(i, 5).Value = format(monxl2.Cells(j, 5),"yy") ' si année sur 2 chiffres "yy" sinon si sur 4 chiffres "yyyy"