Gexk5
XLDnaute Occasionnel
Bonsoir le forum;
Voici mon souci, afin de ne pas perdre mes mises en formes conditionnelles par mauvaise manip de l'utilisateur, je voudrais que mes mises en formes soient recrées à l'ouverture de mon fichier, avec l'enregistreur de macro, j'ai sorti un code, il fonctionne tres bien, seulement il ne traite qu'une parti de ma feuille, comment modifier ce code afin qu'il traite toute la feuille???
J'ai un decalage de 8 lignes a chaque fois.
Je vous donne le code
Merci d'avance a tous ceux qui se pencherons sur mon sujet
Sub Macro3()
Range("C7:S10").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$T$3=""V1"""
Selection.FormatConditions(1).Font.ColorIndex = 2
Selection.FormatConditions(1).Interior.ColorIndex = 2
Range("U7:W10").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$T$3=""V1"""
Selection.FormatConditions(1).Font.ColorIndex = 2
Selection.FormatConditions(1).Interior.ColorIndex = 2
Range("O6:S6").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$T$3=""V2"""
Selection.FormatConditions(1).Font.ColorIndex = 2
Selection.FormatConditions(1).Interior.ColorIndex = 2
Range("O10:S10").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$T$3=""V1"""
Selection.FormatConditions(1).Font.ColorIndex = 2
Selection.FormatConditions(1).Interior.ColorIndex = 2
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$T$3=""V2"""
Selection.FormatConditions(2).Font.ColorIndex = 2
Selection.FormatConditions(2).Interior.ColorIndex = 2
Range("T7").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$T$3=""V1"""
Selection.FormatConditions(1).Font.ColorIndex = 2
Selection.FormatConditions(1).Interior.ColorIndex = 2
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$T$3=""V2"""
Selection.FormatConditions(2).Font.ColorIndex = xlAutomatic
Selection.FormatConditions(2).Interior.ColorIndex = 35
Range("A1").Select
End Sub
' decalage de 8 lignes a chaque fois jusqu'à la ligne 250
'Range("C15:S18").Select
'Selection.FormatConditions.Delete
'Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$T$11=""V1"""
'Selection.FormatConditions(1).Font.ColorIndex = 2
'Selection.FormatConditions(1).Interior.ColorIndex = 2
@micalement
Voici mon souci, afin de ne pas perdre mes mises en formes conditionnelles par mauvaise manip de l'utilisateur, je voudrais que mes mises en formes soient recrées à l'ouverture de mon fichier, avec l'enregistreur de macro, j'ai sorti un code, il fonctionne tres bien, seulement il ne traite qu'une parti de ma feuille, comment modifier ce code afin qu'il traite toute la feuille???
J'ai un decalage de 8 lignes a chaque fois.
Je vous donne le code
Merci d'avance a tous ceux qui se pencherons sur mon sujet
Sub Macro3()
Range("C7:S10").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$T$3=""V1"""
Selection.FormatConditions(1).Font.ColorIndex = 2
Selection.FormatConditions(1).Interior.ColorIndex = 2
Range("U7:W10").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$T$3=""V1"""
Selection.FormatConditions(1).Font.ColorIndex = 2
Selection.FormatConditions(1).Interior.ColorIndex = 2
Range("O6:S6").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$T$3=""V2"""
Selection.FormatConditions(1).Font.ColorIndex = 2
Selection.FormatConditions(1).Interior.ColorIndex = 2
Range("O10:S10").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$T$3=""V1"""
Selection.FormatConditions(1).Font.ColorIndex = 2
Selection.FormatConditions(1).Interior.ColorIndex = 2
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$T$3=""V2"""
Selection.FormatConditions(2).Font.ColorIndex = 2
Selection.FormatConditions(2).Interior.ColorIndex = 2
Range("T7").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$T$3=""V1"""
Selection.FormatConditions(1).Font.ColorIndex = 2
Selection.FormatConditions(1).Interior.ColorIndex = 2
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$T$3=""V2"""
Selection.FormatConditions(2).Font.ColorIndex = xlAutomatic
Selection.FormatConditions(2).Interior.ColorIndex = 35
Range("A1").Select
End Sub
' decalage de 8 lignes a chaque fois jusqu'à la ligne 250
'Range("C15:S18").Select
'Selection.FormatConditions.Delete
'Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$T$11=""V1"""
'Selection.FormatConditions(1).Font.ColorIndex = 2
'Selection.FormatConditions(1).Interior.ColorIndex = 2
@micalement