[VBA-E] Limitation des With...End With
Bjr,
Peut-on optimiser ce genre de code pour éviter les répétitions with (F1 ne donne pas beaucoup d'exemples)
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| With Range("A1")
.FormulaR1C1 = "ANCIEN"
.Interior.ColorIndex = 35
End With
With Range("B1")
.FormulaR1C1 = "NOUVEAU"
.Interior.ColorIndex = 36
End With
With Range("C1")
.FormulaR1C1 = "RESTÉES"
.Interior.ColorIndex = 37
End With
With Range("D1")
.FormulaR1C1 = "BAPB"
.Interior.ColorIndex = 38
End With
With Range("E1")
.FormulaR1C1 = "NOUVELLES"
.Interior.ColorIndex = 39
End With |
VBA-E Limitation des With...End With
Merci Silky ça fonctionne.
Le seul problème c'est si on veut pas des index couleurs qui se suivent.
Mais c'est un détail pas très important.
Ps
J'ai modifié le titre pour faire plaisir à Dvano.
Cdt