Bonjour j'écrit ce message car j'ai un petit problème sur ma macro en ai fait j'ai réaliser une macro qui marche parfaitement, mais le problème ces qu'elle est beaucoup trop longue alors j'aimerais savoir si ces possible de la réduire un petit peu.
merci de votre aide voici ma macro :
Je l'explique, donc je vais chercher une case dans un autre onglet de mon fichier Excel, à partir de là je créer une MFC en disant que si la valeur de ma case que j'ai été chercher est supérieur ou égal a 1 alors ma case se met en bleu claire encadrer .
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40 Sub Macro7() ' ' Macro7 Macro ' ' Range("L15").Select ActiveCell.FormulaR1C1 = "=P!R[-7]C[-9]" Range("L15").Select Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _ , Formula1:="=1" Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority With Selection.FormatConditions(1).Borders(xlLeft) .LineStyle = xlContinuous .TintAndShade = 0 .Weight = xlThin End With With Selection.FormatConditions(1).Borders(xlRight) .LineStyle = xlContinuous .TintAndShade = 0 .Weight = xlThin End With With Selection.FormatConditions(1).Borders(xlTop) .LineStyle = xlContinuous .TintAndShade = 0 .Weight = xlThin End With With Selection.FormatConditions(1).Borders(xlBottom) .LineStyle = xlContinuous .TintAndShade = 0 .Weight = xlThin End With With Selection.FormatConditions(1).Interior .PatternColorIndex = xlAutomatic .ThemeColor = xlThemeColorLight2 .TintAndShade = 0.799981688894314 End With Selection.FormatConditions(1).StopIfTrue = False End Sub
Partager