Kael_88
XLDnaute Occasionnel
Le forum,
Si cela était possible, je voudrai savoir s'il est possible de simplifier le code suivant et par quoi.
pour résumer, dans un tableau, on colorie les cellules une ligne sur deux en partant des cellules ligne 2
pour les colonnes :
C à F en vert,
G à I en rose pale,
J à K en vert pale,
L à N en bleu pale,
O à P en orange pale,
cordialement
Si cela était possible, je voudrai savoir s'il est possible de simplifier le code suivant et par quoi.
pour résumer, dans un tableau, on colorie les cellules une ligne sur deux en partant des cellules ligne 2
pour les colonnes :
C à F en vert,
G à I en rose pale,
J à K en vert pale,
L à N en bleu pale,
O à P en orange pale,
cordialement
VB:
' Reference centrée
Rows("3").Select
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
' Couleur colonne
Range("C4:F4").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 5296274
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Range("G4:I4").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent2
.TintAndShade = 0.799981688894314
.PatternTintAndShade = 0
End With
Range("J4:K4").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent6
.TintAndShade = 0.799981688894314
.PatternTintAndShade = 0
End With
Range("L4:N4").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent5
.TintAndShade = 0.799981688894314
.PatternTintAndShade = 0
End With
Range("O4:P4").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent4
.TintAndShade = 0.799981688894314
.PatternTintAndShade = 0
End With
Range("Q4:R4").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent3
.TintAndShade = 0.799981688894314
.PatternTintAndShade = 0
End With
Rows("3:4").Select
Selection.Copy
Range(Selection, Selection.End(xlDown)).Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("A2").Select
Application.CutCopyMode = False
Dernière édition: