Bonjour à tous jai un pb dans ma macro et je n'arrive pas à le resoudre seul, c'est pas faute d'avoir essayé.
Merci donc de votre aide.
Voici ce que je souhaiterais faire :
En fonction de la valeur mise en colonne I, une coleur vienne remplir toute la ligne correspondant.
Ayant 10 condition, j'ai abandonné la MFC.
Voici ma macro, mais le TARGET.ROW, m'empêche d'aller au dela de la 256 ieme ligne et je ne sais pas pourquoi (J'ai environ 1500 lignes...) :
Private Sub Worksheet_Change(ByVal Target As Range)
Dim lig As Byte, plage As Range
If Intersect(Target, Range("i2:i1500")) Is Nothing Then: Exit Sub
lig = Target.Row
Set plage = Range(Cells(lig, 1), Cells(lig, 14))
Select Case Target
Case Is = "ACAD"
plage.Interior.ColorIndex = 7 'GRIS"
Case Is = "SPRQ"
plage.Interior.Color = 65535 'JAUNE"
Case Is = "RCBA"
plage.Interior.Color = 10040319 'ROSE FUSHIA"
Case Is = "NMRT"
plage.Interior.Color = 16777164 'BLEU CIEL"
Case Is = "CRNI"
plage.Interior.Color = 13434828 'VERT PALE"
Case Is = "JLPR"
plage.Interior.Color = 52479 'ORANGE PALE"
Case Is = "FFTE"
plage.Interior.Color = 16724889 'VIOLET"
Case Is = "MMAO"
plage.Interior.ColorIndex = 31 'BLEU FONCE"
Case Is = "LRUE"
plage.Interior.Color = 16764159 'ROSE PALE"
Case Is = "HSTR"
plage.Interior.Color = 16776960 'BLEU TURQUOISE"
Case Else
plage.Interior.ColorIndex = -4142 ' enlève la couleur
End Select
Set plage = Nothing
End Sub
Par avance merci de vos retour
Bonne journée et merci
Merci donc de votre aide.
Voici ce que je souhaiterais faire :
En fonction de la valeur mise en colonne I, une coleur vienne remplir toute la ligne correspondant.
Ayant 10 condition, j'ai abandonné la MFC.
Voici ma macro, mais le TARGET.ROW, m'empêche d'aller au dela de la 256 ieme ligne et je ne sais pas pourquoi (J'ai environ 1500 lignes...) :
Private Sub Worksheet_Change(ByVal Target As Range)
Dim lig As Byte, plage As Range
If Intersect(Target, Range("i2:i1500")) Is Nothing Then: Exit Sub
lig = Target.Row
Set plage = Range(Cells(lig, 1), Cells(lig, 14))
Select Case Target
Case Is = "ACAD"
plage.Interior.ColorIndex = 7 'GRIS"
Case Is = "SPRQ"
plage.Interior.Color = 65535 'JAUNE"
Case Is = "RCBA"
plage.Interior.Color = 10040319 'ROSE FUSHIA"
Case Is = "NMRT"
plage.Interior.Color = 16777164 'BLEU CIEL"
Case Is = "CRNI"
plage.Interior.Color = 13434828 'VERT PALE"
Case Is = "JLPR"
plage.Interior.Color = 52479 'ORANGE PALE"
Case Is = "FFTE"
plage.Interior.Color = 16724889 'VIOLET"
Case Is = "MMAO"
plage.Interior.ColorIndex = 31 'BLEU FONCE"
Case Is = "LRUE"
plage.Interior.Color = 16764159 'ROSE PALE"
Case Is = "HSTR"
plage.Interior.Color = 16776960 'BLEU TURQUOISE"
Case Else
plage.Interior.ColorIndex = -4142 ' enlève la couleur
End Select
Set plage = Nothing
End Sub
Par avance merci de vos retour
Bonne journée et merci