Vous utilisez un navigateur obsolète. Il se peut que ce site ou d'autres sites Web ne s'affichent pas correctement. Vous devez le mettre à jour ou utiliser un navigateur alternatif.
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 !
Sub T()
Dim commentaire As Comment
With Range("a" & ActiveCell.Row).Resize(, 6)
For i = 1 To .Cells.Count
UserForm1.Controls("TextBox" & i).Text = .Cells(i)
If i >= 4 Then UserForm1.Controls("TextBox" & i).BackColor = .Cells(i).DisplayFormat.Interior.Color
Next
End With
UserForm1.Show
End Sub
bonjour
pour recupérer la couleur appliquée par une MFC il faut utiliser le membre "DisplayFormat de l'object range
VB:
Sub T()
Dim Lig&, commentaire As Comment
Lig = ActiveCell.Row
UserForm1.TextBox1.Text = ActiveCell.Value
UserForm1.TextBox2.Text = Range("B" & Lig).Value
UserForm1.TextBox3.Text = Range("C" & Lig).Value
With Range("D" & Lig).Resize(, 3)
For i = 1 To 3
UserForm1.Controls("TextBox" & i + 3).BackColor = .Cells(i).DisplayFormat.Interior.Color
UserForm1.Controls("TextBox" & i + 3).Value = Cells(i)
Next
End With
UserForm1.Show
End Sub
Sub T()
Dim commentaire As Comment
With Range("a" & ActiveCell.Row).Resize(, 6)
For i = 1 To .Cells.Count
UserForm1.Controls("TextBox" & i).Text = .Cells(i)
If i >= 4 Then UserForm1.Controls("TextBox" & i).BackColor = .Cells(i).DisplayFormat.Interior.Color
Next
End With
UserForm1.Show
End Sub
- 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