nom des textbox qui change par variable

umkapolka

XLDnaute Nouveau
bonjour
je voudrais faire une boucle pour ne pas répèter les different nom de textbox comme exemble si dessus.


If Cells(112, 13) = 5 Then
TextBox5 = TextBox
End If

If Cells(112, 13) = 6 Then
TextBox6 = TextBox
End If

If Cells(112, 13) = 7 Then
TextBox7 = TextBox
End If

If Cells(112, 13) = 8 Then
TextBox8 = TextBox
End If

in si de suite....

comme je pensais

I = Cells(112, 13) ' qui change quand les differente textbox active change,
' Cells(112, 13) = 5 d'autre fois = 7 ou 8......


TextBox (I) = TextBox
end sub

Mais cela ne marche pas

Merci
 

umkapolka

XLDnaute Nouveau
merci pour ta réponce

Controls("textbox" & Cells(112, 13)) = TextBox
mais ce la me donne une nouvel erreur
"sud or fonction not defined"

oui pour Cells(112, 13) = a un nombre, qui change a plusieur reprise c'est elle qui me dit la quel textbox est active
 

Discussions similaires