Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

mise en forme conditionnelle

2 réponses
Avatar
vanessa066
Bonjour,

Dans un fichier excel, j'utilise cette macro :

Private Sub Worksheet_Change(ByVal Target As Range)

If Not Intersect([ChampMFC], Target) Is Nothing Then

Application.EnableEvents = False

On Error Resume Next

[Couleurs].Find(Target, LookAt:=xlWhole).Copy

Target.PasteSpecial Paste:=xlPasteFormats

Application.EnableEvents = True

End If

End Sub

afin de colorer des cellules en fonction de leur contenu.

ça marche très bien, seulement j'aimerais bien qu'il m'applique le coloriage
sur toute la ligne et non juste sur la cellule de la première colonne
(colonne où j'ai ma valeur).
comment faire?

merci

2 réponses

Avatar
JB
Bonjour,

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect([ChampMFC], Target) Is Nothing Then
Application.EnableEvents = False
On Error Resume Next
[couleurs].Find(Target, LookAt:=xlWhole).Copy
Target.EntireRow.PasteSpecial Paste:=xlPasteFormats
Application.EnableEvents = True
End If
End Sub

JB
http://boisgontierjacques.free.fr

On 18 fév, 14:14, vanessa066
wrote:
Bonjour,

Dans un fichier excel, j'utilise cette macro :

Private Sub Worksheet_Change(ByVal Target As Range)

  If Not Intersect([ChampMFC], Target) Is Nothing Then

     Application.EnableEvents = False

     On Error Resume Next

     [Couleurs].Find(Target, LookAt:=xlWhole).Copy

     Target.PasteSpecial Paste:=xlPasteFormats

     Application.EnableEvents = True

  End If

End Sub

afin de colorer des cellules en fonction de leur contenu.

ça marche très bien, seulement j'aimerais bien qu'il m'applique le co loriage
sur toute la ligne et non juste sur la cellule de la première colonne
(colonne où j'ai ma valeur).
comment faire?

merci


Avatar
vanessa066
Merci beaucoup, ça fonctionne.

"JB" a écrit :

Bonjour,

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect([ChampMFC], Target) Is Nothing Then
Application.EnableEvents = False
On Error Resume Next
[couleurs].Find(Target, LookAt:=xlWhole).Copy
Target.EntireRow.PasteSpecial Paste:=xlPasteFormats
Application.EnableEvents = True
End If
End Sub

JB
http://boisgontierjacques.free.fr

On 18 fév, 14:14, vanessa066
wrote:
> Bonjour,
>
> Dans un fichier excel, j'utilise cette macro :
>
> Private Sub Worksheet_Change(ByVal Target As Range)
>
> If Not Intersect([ChampMFC], Target) Is Nothing Then
>
> Application.EnableEvents = False
>
> On Error Resume Next
>
> [Couleurs].Find(Target, LookAt:=xlWhole).Copy
>
> Target.PasteSpecial Paste:=xlPasteFormats
>
> Application.EnableEvents = True
>
> End If
>
> End Sub
>
> afin de colorer des cellules en fonction de leur contenu.
>
> ça marche très bien, seulement j'aimerais bien qu'il m'applique le coloriage
> sur toute la ligne et non juste sur la cellule de la première colonne
> (colonne où j'ai ma valeur).
> comment faire?
>
> merci