" MSFlexGrid1" V.B 6

Fermé
accent19811 Messages postés 105 Date d'inscription mercredi 4 janvier 2012 Statut Membre Dernière intervention 28 mai 2023 - 5 janv. 2012 à 17:08
baladur13 Messages postés 46423 Date d'inscription mercredi 11 avril 2007 Statut Modérateur Dernière intervention 9 mai 2024 - 5 janv. 2012 à 17:40
Bonjour,



Affiche une date + NUM + Prix sur " MSFlexGrid1" V.B6
Mais à condition..:

-Date doit répéter 5 fois
-Chaque fois plus 30 jours.

Voir exemple suivant..:

Num: Date: Prix:

01---- 15/01/2012----500.00
02---- 15/02/2012----500.00
03---- 15/03/2012----500.00
04---- 15/04/2012----500.00
05---- 15/05/2012----500.00

2 réponses

f894009 Messages postés 17189 Date d'inscription dimanche 25 novembre 2007 Statut Membre Dernière intervention 6 mai 2024 1 705
5 janv. 2012 à 17:37
RE

Private Sub Form_Load()
Dim Date_Maintenant, Date_Mois_Suivant, i

'MSFlexGrig a 2 colonnes et 6 ligne (Titre + 5 mois)
Me.MSFlexGrid1.Clear
Me.MSFlexGrid1.Cols = 4
MSFlexGrid1.Rows = 6


Date_Maintenant = Now
Date_Mois_Suivant = Date_Maintenant

' Ecriture du titre Colonne1
With MSFlexGrid1
.TextMatrix(0, 1) = "Num"
.TextMatrix(0, 2) = "Date"
.TextMatrix(0, 3) = "Prix"

'Ecriture Date Aujourd'hui Colonne1
.TextMatrix(1, 1) = "01"
.TextMatrix(1, 2) = Format(Date_Mois_Suivant, "DD/MM/YYYY")
.TextMatrix(1, 3) = "500.00"

'ecriture quatre mois suivants
For i = 2 To 5
.TextMatrix(i, 1) = Format(i, "00")
Date_Mois_Suivant = Format(DateAdd("m", 1, Date_Mois_Suivant), "dd/mm/yyyy")
.TextMatrix(i, 2) = Format(Date_Mois_Suivant, "DD/MM/YYYY")
.TextMatrix(i, 3) = "500.00"
Next i

End With

End Sub

Bonne suite
0
baladur13 Messages postés 46423 Date d'inscription mercredi 11 avril 2007 Statut Modérateur Dernière intervention 9 mai 2024 13 234
5 janv. 2012 à 17:40
Bonjour
________              ___.   .__                 
\______ \   ____  __ _\_ |__ |  |   ____   ____  
 |    |  \ /  _ \|  |  \ __ \|  |  /  _ \ /    \ 
 |    '   (  <_> )  |  / \_\ \  |_(  <_> )   |  \
/_______  /\____/|____/|___  /____/\____/|___|  /
        \/                 \/                 \/ 

La suite ici :https://forums.commentcamarche.net/forum/affich-24103405-affiche-une-date-sur-msflexgrid1-v-b-6#p24104452
0