Couleur de fonf d'une textbox sur une feuille

  • Initiateur de la discussion Initiateur de la discussion maval
  • Date de début Date de début

Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

maval

XLDnaute Barbatruc
Bonjour


J'ai trois texbox sur une feuille que j'alimente avec une combobox qui se trouve sur la même feuille et j'aimerai que mes textbox on un fond bleu.
Mon code est:

Code:
Private Sub ComboBox1_Click()
Call Oter_Couleur
n = Feuil2.Cells(ComboBox1.ListIndex + 2, 1)
If n = "" Then Exit Sub
If Left(n, 4) = "EU0" Then
n = Right(n, 1)

Else
n = Right(n, 2)
End If
'End If
ActiveSheet.Shapes("EU-" & n).Select
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 3
ActiveSheet.Shapes("TextBox95").Select
Selection.Caption = "Département :  " & Feuil2.Cells(ComboBox1.ListIndex + 2, 3) & "  " & Feuil2.Cells(ComboBox1.ListIndex + 2, 4)
ActiveSheet.Shapes("Text Box 97").Select
Selection.Caption = "Région :  " & Feuil2.Cells(ComboBox1.ListIndex + 2, 4) & "  " & Feuil2.Cells(ComboBox1.ListIndex + 3, 7)
ActiveSheet.Shapes("Text Box 96").Select
Selection.Caption = "Code Postal :  " & Feuil2.Cells(ComboBox1.ListIndex + 2, 2) & "  " & Feuil2.Cells(ComboBox1.ListIndex + 3, 7)
[A1].Select

End Sub

Merci d'avance
 
Re : Couleur de fonf d'une textbox sur une feuille

Bonjour Maval
pour le fond bleu du textbox95
Code:
activesheet.textbox95.backcolor= &HFF0000
et tous tes select ne servent à rien
Code:
ActiveSheet.Shapes("TextBox95").Select
Selection.Caption = "Département :  " &  Feuil2.Cells(ComboBox1.ListIndex + 2, 3) & "  " &  Feuil2.Cells(ComboBox1.ListIndex + 2, 4)
est égal à
Code:
activesheet.textbox95.caption="Département :  " &  Feuil2.Cells(ComboBox1.ListIndex + 2, 3) & "  " &  Feuil2.Cells(ComboBox1.ListIndex + 2, 4)
a+
Papou😱
 
Dernière édition:
- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

Réponses
10
Affichages
281
Réponses
5
Affichages
235
Réponses
8
Affichages
466
Réponses
3
Affichages
665
Retour