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.
