textbox & i

  • Initiateur de la discussion bret
  • Date de début
B

bret

Guest
textbox & i

Bonjour @ tous !




Comment écrire ou simplifier ceci:


textbox1=""
textbox2=""
textbox3=""
textbox4=""
textbox5=""
textbox6=""
textbox7=""

Peut-on écrire qqchse dans ce genre :

for i=1 to 7
textbox & i = ""
next i

merci !

ps: je remercie les personnes de ce forum qui donnent les soluces à nos questions ! vous etes cooooool !!
 
P

Pascal76

Guest
Re: textbox & i

Salut

Voilà une première solution si tu veux que tous tes textbox soient remis à zéro.

For Each ct In UserForm1.Controls
If TypeName(ct) = "TextBox" Then ct.Value = ""
Next

Bon courage

Pascal

Je continue à regarder pour le cas for i=
 
B

bret

Guest
Re: textbox & i

merci ! beaucoup !

de la meme maniere, est-ce qu' il y a plus simple pour ça :

With TextBox1
.Enabled = False
.BackColor = RGB(255, 255, 255)
End With
With TextBox2
.Enabled = False
.BackColor = RGB(255, 255, 255)
End With
With TextBox3
.Enabled = False
.BackColor = RGB(255, 255, 255)
End With
With TextBox4
.Enabled = False
.BackColor = RGB(255, 255, 255)
End With
With TextBox5
.Enabled = False
.BackColor = RGB(255, 255, 255)
End With
 

Discussions similaires

Réponses
15
Affichages
883