begin process at 2008 08 30 19:06:10
1 234 151 membres
184 nouveaux aujourd'hui
14 294 membres club

Vous ne trouvez pas de réponse à votre problème ? Alors posez la question dans le forum.
Souvenez-vous qu'il n'y a jamais de question bête, mais rester dans l'ignorance parce que l'on n'ose pas poser une question, ça c'est une erreur !

Sujet : Simplifier un bout de code [ Archives Visual Basic / VBA ] (Baboune1)

Simplifier un bout de code le 18/03/2002 20:27:11

Baboune1
Salut,
Quelqu'un saurait me dire comment simplifier ce code :

FormCalendrier.Bouton1.Caption = Calendar(1, 1)
FormCalendrier.Bouton2.Caption = Calendar(1, 2)
FormCalendrier.Bouton3.Caption = Calendar(1, 3)
FormCalendrier.Bouton4.Caption = Calendar(1, 4)
FormCalendrier.Bouton5.Caption = Calendar(1, 5)
FormCalendrier.Bouton6.Caption = Calendar(1, 6)
FormCalendrier.Bouton7.Caption = Calendar(1, 7)
FormCalendrier.Bouton8.Caption = Calendar(2, 1)
FormCalendrier.Bouton9.Caption = Calendar(2, 2)
FormCalendrier.Bouton10.Caption = Calendar(2, 3)
FormCalendrier.Bouton11.Caption = Calendar(2, 4)
FormCalendrier.Bouton12.Caption = Calendar(2, 5)
FormCalendrier.Bouton13.Caption = Calendar(2, 6)
FormCalendrier.Bouton14.Caption = Calendar(2, 7)

FormCalendrier.Bouton X.Caption= Calendar(Y, Z)
ne fonctionne pas !

Merci de votre aide.

Re : Simplifier un bout de code le 19/03/2002 08:22:37

Neo.balastik
Salut,

Essaye cela:

Dim Counter As Byte
Dim Y As Byte
Dim Z As Byte

Y = 1

For i = 1 To 14

If i > 7 Then Y = 2
If Z = 8 Then Z = 0

Z = Z + 1

FormCalendrier.Controls("Bouton" & Trim$(Str$(i))).Caption = Calendar(Y, Z)

Next i

Tchao

NéoB

-------------------------------
Réponse au message :
-------------------------------

Salut,
Quelqu'un saurait me dire comment simplifier ce code :

FormCalendrier.Bouton1.Caption = Calendar(1, 1)
FormCalendrier.Bouton2.Caption = Calendar(1, 2)
FormCalendrier.Bouton3.Caption = Calendar(1, 3)
FormCalendrier.Bouton4.Caption = Calendar(1, 4)
FormCalendrier.Bouton5.Caption = Calendar(1, 5)
FormCalendrier.Bouton6.Caption = Calendar(1, 6)
FormCalendrier.Bouton7.Caption = Calendar(1, 7)
FormCalendrier.Bouton8.Caption = Calendar(2, 1)
FormCalendrier.Bouton9.Caption = Calendar(2, 2)
FormCalendrier.Bouton10.Caption = Calendar(2, 3)
FormCalendrier.Bouton11.Caption = Calendar(2, 4)
FormCalendrier.Bouton12.Caption = Calendar(2, 5)
FormCalendrier.Bouton13.Caption = Calendar(2, 6)
FormCalendrier.Bouton14.Caption = Calendar(2, 7)

FormCalendrier.Bouton X.Caption= Calendar(Y, Z)
ne fonctionne pas !

Merci de votre aide.

Re : Simplifier un bout de code le 19/03/2002 12:05:00

Schouly
Je serai de toi je créerai un tableau d'élément ...

Tu crée un Bouton et tu lui met l'index 1 ... ensuite

tu fais des copier coller de ton bouton ... ça donnera une succesion d'index. tu pourras l'utiliser comme :

FormCalendrier.Bouton(14).Caption = Calendar(2, 7)

FormCalendrier.Bouton(X).Caption = Calendar(2, 7)







-------------------------------
Réponse au message :
-------------------------------

Salut,

Essaye cela:

Dim Counter As Byte
Dim Y As Byte
Dim Z As Byte

Y = 1

For i = 1 To 14

If i > 7 Then Y = 2
If Z = 8 Then Z = 0

Z = Z + 1

FormCalendrier.Controls("Bouton" & Trim$(Str$(i))).Caption = Calendar(Y, Z)

Next i

Tchao

NéoB

-------------------------------
Réponse au message :
-------------------------------

Salut,
Quelqu'un saurait me dire comment simplifier ce code :

FormCalendrier.Bouton1.Caption = Calendar(1, 1)
FormCalendrier.Bouton2.Caption = Calendar(1, 2)
FormCalendrier.Bouton3.Caption = Calendar(1, 3)
FormCalendrier.Bouton4.Caption = Calendar(1, 4)
FormCalendrier.Bouton5.Caption = Calendar(1, 5)
FormCalendrier.Bouton6.Caption = Calendar(1, 6)
FormCalendrier.Bouton7.Caption = Calendar(1, 7)
FormCalendrier.Bouton8.Caption = Calendar(2, 1)
FormCalendrier.Bouton9.Caption = Calendar(2, 2)
FormCalendrier.Bouton10.Caption = Calendar(2, 3)
FormCalendrier.Bouton11.Caption = Calendar(2, 4)
FormCalendrier.Bouton12.Caption = Calendar(2, 5)
FormCalendrier.Bouton13.Caption = Calendar(2, 6)
FormCalendrier.Bouton14.Caption = Calendar(2, 7)

FormCalendrier.Bouton X.Caption= Calendar(Y, Z)
ne fonctionne pas !

Merci de votre aide.


Re : Simplifier un bout de code le 19/03/2002 12:10:48

Neo.balastik
Salut,

Pour ton information, il s'agit de l'environnement Excel et non VB. Il n'est pas possible de créer des tableaux de contrôles dans Excel contrairement à VB...

Alors ma méthode reste d'actualité !

Tchao

NéoB



-------------------------------
Réponse au message :
-------------------------------

Je serai de toi je créerai un tableau d'élément ...

Tu crée un Bouton et tu lui met l'index 1 ... ensuite

tu fais des copier coller de ton bouton ... ça donnera une succesion d'index. tu pourras l'utiliser comme :

FormCalendrier.Bouton(14).Caption = Calendar(2, 7)

FormCalendrier.Bouton(X).Caption = Calendar(2, 7)







-------------------------------
Réponse au message :
-------------------------------

Salut,

Essaye cela:

Dim Counter As Byte
Dim Y As Byte
Dim Z As Byte

Y = 1

For i = 1 To 14

If i > 7 Then Y = 2
If Z = 8 Then Z = 0

Z = Z + 1

FormCalendrier.Controls("Bouton" & Trim$(Str$(i))).Caption = Calendar(Y, Z)

Next i

Tchao

NéoB

-------------------------------
Réponse au message :
-------------------------------

Salut,
Quelqu'un saurait me dire comment simplifier ce code :

FormCalendrier.Bouton1.Caption = Calendar(1, 1)
FormCalendrier.Bouton2.Caption = Calendar(1, 2)
FormCalendrier.Bouton3.Caption = Calendar(1, 3)
FormCalendrier.Bouton4.Caption = Calendar(1, 4)
FormCalendrier.Bouton5.Caption = Calendar(1, 5)
FormCalendrier.Bouton6.Caption = Calendar(1, 6)
FormCalendrier.Bouton7.Caption = Calendar(1, 7)
FormCalendrier.Bouton8.Caption = Calendar(2, 1)
FormCalendrier.Bouton9.Caption = Calendar(2, 2)
FormCalendrier.Bouton10.Caption = Calendar(2, 3)
FormCalendrier.Bouton11.Caption = Calendar(2, 4)
FormCalendrier.Bouton12.Caption = Calendar(2, 5)
FormCalendrier.Bouton13.Caption = Calendar(2, 6)
FormCalendrier.Bouton14.Caption = Calendar(2, 7)

FormCalendrier.Bouton X.Caption= Calendar(Y, Z)
ne fonctionne pas !

Merci de votre aide.



Re : Simplifier un bout de code le 19/03/2002 18:48:24

Schouly

Excuse ...

j'ai vu nul part qu'il s'agissait de VBA ... mais si oui t'as entièrement raison ...


-------------------------------
Réponse au message :
-------------------------------

Salut,

Pour ton information, il s'agit de l'environnement Excel et non VB. Il n'est pas possible de créer des tableaux de contrôles dans Excel contrairement à VB...

Alors ma méthode reste d'actualité !

Tchao

NéoB



-------------------------------
Réponse au message :
-------------------------------

Je serai de toi je créerai un tableau d'élément ...

Tu crée un Bouton et tu lui met l'index 1 ... ensuite

tu fais des copier coller de ton bouton ... ça donnera une succesion d'index. tu pourras l'utiliser comme :

FormCalendrier.Bouton(14).Caption = Calendar(2, 7)

FormCalendrier.Bouton(X).Caption = Calendar(2, 7)







-------------------------------
Réponse au message :
-------------------------------

Salut,

Essaye cela:

Dim Counter As Byte
Dim Y As Byte
Dim Z As Byte

Y = 1

For i = 1 To 14

If i > 7 Then Y = 2
If Z = 8 Then Z = 0

Z = Z + 1

FormCalendrier.Controls("Bouton" & Trim$(Str$(i))).Caption = Calendar(Y, Z)

Next i

Tchao

NéoB

-------------------------------
Réponse au message :
-------------------------------

Salut,
Quelqu'un saurait me dire comment simplifier ce code :

FormCalendrier.Bouton1.Caption = Calendar(1, 1)
FormCalendrier.Bouton2.Caption = Calendar(1, 2)
FormCalendrier.Bouton3.Caption = Calendar(1, 3)
FormCalendrier.Bouton4.Caption = Calendar(1, 4)
FormCalendrier.Bouton5.Caption = Calendar(1, 5)
FormCalendrier.Bouton6.Caption = Calendar(1, 6)
FormCalendrier.Bouton7.Caption = Calendar(1, 7)
FormCalendrier.Bouton8.Caption = Calendar(2, 1)
FormCalendrier.Bouton9.Caption = Calendar(2, 2)
FormCalendrier.Bouton10.Caption = Calendar(2, 3)
FormCalendrier.Bouton11.Caption = Calendar(2, 4)
FormCalendrier.Bouton12.Caption = Calendar(2, 5)
FormCalendrier.Bouton13.Caption = Calendar(2, 6)
FormCalendrier.Bouton14.Caption = Calendar(2, 7)

FormCalendrier.Bouton X.Caption= Calendar(Y, Z)
ne fonctionne pas !

Merci de votre aide.




Merci pour votre aide le 20/03/2002 21:14:35

Baboune1
Tout est dans le titre

Comme d'habitude, il y a toujours quelqu'un pour aider un apprenti codeur dans le besoin.

Ne changer rien.


-------------------------------
Réponse au message :
-------------------------------


Excuse ...

j'ai vu nul part qu'il s'agissait de VBA ... mais si oui t'as entièrement raison ...


-------------------------------
Réponse au message :
-------------------------------

Salut,

Pour ton information, il s'agit de l'environnement Excel et non VB. Il n'est pas possible de créer des tableaux de contrôles dans Excel contrairement à VB...

Alors ma méthode reste d'actualité !

Tchao

NéoB



-------------------------------
Réponse au message :
-------------------------------

Je serai de toi je créerai un tableau d'élément ...

Tu crée un Bouton et tu lui met l'index 1 ... ensuite

tu fais des copier coller de ton bouton ... ça donnera une succesion d'index. tu pourras l'utiliser comme :

FormCalendrier.Bouton(14).Caption = Calendar(2, 7)

FormCalendrier.Bouton(X).Caption = Calendar(2, 7)







-------------------------------
Réponse au message :
-------------------------------

Salut,

Essaye cela:

Dim Counter As Byte
Dim Y As Byte
Dim Z As Byte

Y = 1

For i = 1 To 14

If i > 7 Then Y = 2
If Z = 8 Then Z = 0

Z = Z + 1

FormCalendrier.Controls("Bouton" & Trim$(Str$(i))).Caption = Calendar(Y, Z)

Next i

Tchao

NéoB

-------------------------------
Réponse au message :
-------------------------------

Salut,
Quelqu'un saurait me dire comment simplifier ce code :

FormCalendrier.Bouton1.Caption = Calendar(1, 1)
FormCalendrier.Bouton2.Caption = Calendar(1, 2)
FormCalendrier.Bouton3.Caption = Calendar(1, 3)
FormCalendrier.Bouton4.Caption = Calendar(1, 4)
FormCalendrier.Bouton5.Caption = Calendar(1, 5)
FormCalendrier.Bouton6.Caption = Calendar(1, 6)
FormCalendrier.Bouton7.Caption = Calendar(1, 7)
FormCalendrier.Bouton8.Caption = Calendar(2, 1)
FormCalendrier.Bouton9.Caption = Calendar(2, 2)
FormCalendrier.Bouton10.Caption = Calendar(2, 3)
FormCalendrier.Bouton11.Caption = Calendar(2, 4)
FormCalendrier.Bouton12.Caption = Calendar(2, 5)
FormCalendrier.Bouton13.Caption = Calendar(2, 6)
FormCalendrier.Bouton14.Caption = Calendar(2, 7)

FormCalendrier.Bouton X.Caption= Calendar(Y, Z)
ne fonctionne pas !

Merci de votre aide.






Classé sous : code, caption, calendar, simplifier, formcalendrier

Participer à cet échange

Pub



Appels d'offres

Recherche developpeur ...
Budget : 700€
SITE MARCHAND LOCATION...
Budget : 3 000€
SITE MARCHAND POUR HOTEL
Budget : 4 000€

CalendriCode

Août 2008
LMMJVSD
    123
45678910
11121314151617
18192021222324
25262728293031

VS Express FR Gratuit !

VS Express en français et 100% gratuit !

Téléchargements

Logiciels à télécharger sur le même thème :

Boutique

Boutique de goodies CodeS-SourceS