Bonjour,
j'ai effectué une macro mais je souhaiterais l'optimiser et la réduire mais je ne trouve pas comment, pouvez vous m'aider svp ?
j'ai effectué une macro mais je souhaiterais l'optimiser et la réduire mais je ne trouve pas comment, pouvez vous m'aider svp ?
VB:
Sub ROUGE()
Dim i, j, k As Integer
Dim x As Variant
i = 127
Do
i = i + 1
Loop Until Feuil1.Range("B" & i).Text = "GÉNÉRATEURS"
k = 4
Feuil1.Range("AB" & i + k).FormulaR1C1 = "=IFERROR(FIND(""Chaud"",RC[-11],1),"""")"
x = Feuil1.Range("AB" & i + k).Value
If Feuil1.Range("AB" & i + k) <> "" Then
Feuil1.Cells(i + k, "Q").Characters(Start:=x, Length:=5).Font.FontStyle = "Gras"
Feuil1.Cells(i + k, "Q").Characters(Start:=x, Length:=5).Font.Color = RGB(192, 0, 0)
End If
Feuil1.Range("AB" & i + k).ClearContents
k = 10
Feuil1.Range("AB" & i + k).FormulaR1C1 = "=IFERROR(FIND(""Chaud"",RC[-19],1),"""")"
x = Feuil1.Range("AB" & i + k).Value
If Feuil1.Range("AB" & i + k) <> "" Then
Feuil1.Cells(i + k, "I").Characters(Start:=x, Length:=5).Font.FontStyle = "Gras"
Feuil1.Cells(i + k, "I").Characters(Start:=x, Length:=5).Font.Color = RGB(192, 0, 0)
End If
Feuil1.Range("AB" & i + k).ClearContents
k = 11
Feuil1.Range("AB" & i + k).FormulaR1C1 = "=IFERROR(FIND(""Chaud"",RC[-19],1),"""")"
x = Feuil1.Range("AB" & i + k).Value
If Feuil1.Range("AB" & i + k) <> "" Then
Feuil1.Cells(i + k, "I").Characters(Start:=x, Length:=5).Font.FontStyle = "Gras"
Feuil1.Cells(i + k, "I").Characters(Start:=x, Length:=5).Font.Color = RGB(192, 0, 0)
End If
Feuil1.Range("AB" & i + k).ClearContents
k = 4
Feuil1.Range("AB" & i + k).FormulaR1C1 = "=IFERROR(FIND(""chaud"",RC[-11],1),"""")"
x = Feuil1.Range("AB" & i + k).Value
If Feuil1.Range("AB" & i + k) <> "" Then
Feuil1.Cells(i + k, "Q").Characters(Start:=x, Length:=5).Font.FontStyle = "Gras"
Feuil1.Cells(i + k, "Q").Characters(Start:=x, Length:=5).Font.Color = RGB(192, 0, 0)
End If
Feuil1.Range("AB" & i + k).ClearContents
k = 10
Feuil1.Range("AB" & i + k).FormulaR1C1 = "=IFERROR(FIND(""chaud"",RC[-19],1),"""")"
x = Feuil1.Range("AB" & i + k).Value
If Feuil1.Range("AB" & i + k) <> "" Then
Feuil1.Cells(i + k, "I").Characters(Start:=x, Length:=5).Font.FontStyle = "Gras"
Feuil1.Cells(i + k, "I").Characters(Start:=x, Length:=5).Font.Color = RGB(192, 0, 0)
End If
Feuil1.Range("AB" & i + k).ClearContents
k = 11
Feuil1.Range("AB" & i + k).FormulaR1C1 = "=IFERROR(FIND(""chaud"",RC[-19],1),"""")"
x = Feuil1.Range("AB" & i + k).Value
If Feuil1.Range("AB" & i + k) <> "" Then
Feuil1.Cells(i + k, "I").Characters(Start:=x, Length:=5).Font.FontStyle = "Gras"
Feuil1.Cells(i + k, "I").Characters(Start:=x, Length:=5).Font.Color = RGB(192, 0, 0)
End If
Feuil1.Range("AB" & i + k).ClearContents
'''
Feuil1.Range("AB" & i + k).FormulaR1C1 = "=IFERROR(FIND(""chaud seul"",RC[-11],1),"""")"
x = Feuil1.Range("AB" & i + k).Value
If Feuil1.Range("AB" & i + k) <> "" Then
Feuil1.Cells(i + k, "Q").Characters(Start:=x, Length:=10).Font.FontStyle = "Gras"
Feuil1.Cells(i + k, "Q").Characters(Start:=x, Length:=10).Font.Color = RGB(192, 0, 0)
End If
Feuil1.Range("AB" & i + k).ClearContents
k = 10
Feuil1.Range("AB" & i + k).FormulaR1C1 = "=IFERROR(FIND(""chaud seul"",RC[-19],1),"""")"
x = Feuil1.Range("AB" & i + k).Value
If Feuil1.Range("AB" & i + k) <> "" Then
Feuil1.Cells(i + k, "I").Characters(Start:=x, Length:=10).Font.FontStyle = "Gras"
Feuil1.Cells(i + k, "I").Characters(Start:=x, Length:=10).Font.Color = RGB(192, 0, 0)
End If
Feuil1.Range("AB" & i + k).ClearContents
k = 11
Feuil1.Range("AB" & i + k).FormulaR1C1 = "=IFERROR(FIND(""chaud seul"",RC[-19],1),"""")"
x = Feuil1.Range("AB" & i + k).Value
If Feuil1.Range("AB" & i + k) <> "" Then
Feuil1.Cells(i + k, "I").Characters(Start:=x, Length:=10).Font.FontStyle = "Gras"
Feuil1.Cells(i + k, "I").Characters(Start:=x, Length:=10).Font.Color = RGB(192, 0, 0)
End If
Feuil1.Range("AB" & i + k).ClearContents
k = 4
Feuil1.Range("AB" & i + k).FormulaR1C1 = "=IFERROR(FIND(""Chaud seul"",RC[-11],1),"""")"
x = Feuil1.Range("AB" & i + k).Value
If Feuil1.Range("AB" & i + k) <> "" Then
Feuil1.Cells(i + k, "Q").Characters(Start:=x, Length:=10).Font.FontStyle = "Gras"
Feuil1.Cells(i + k, "Q").Characters(Start:=x, Length:=10).Font.Color = RGB(192, 0, 0)
End If
Feuil1.Range("AB" & i + k).ClearContents
k = 10
Feuil1.Range("AB" & i + k).FormulaR1C1 = "=IFERROR(FIND(""Chaud seul"",RC[-19],1),"""")"
x = Feuil1.Range("AB" & i + k).Value
If Feuil1.Range("AB" & i + k) <> "" Then
Feuil1.Cells(i + k, "I").Characters(Start:=x, Length:=10).Font.FontStyle = "Gras"
Feuil1.Cells(i + k, "I").Characters(Start:=x, Length:=10).Font.Color = RGB(192, 0, 0)
End If
Feuil1.Range("AB" & i + k).ClearContents
k = 11
Feuil1.Range("AB" & i + k).FormulaR1C1 = "=IFERROR(FIND(""Chaud seul"",RC[-19],1),"""")"
x = Feuil1.Range("AB" & i + k).Value
If Feuil1.Range("AB" & i + k) <> "" Then
Feuil1.Cells(i + k, "I").Characters(Start:=x, Length:=10).Font.FontStyle = "Gras"
Feuil1.Cells(i + k, "I").Characters(Start:=x, Length:=10).Font.Color = RGB(192, 0, 0)
End If
Feuil1.Range("AB" & i + k).ClearContents
k = 4
Feuil1.Range("AB" & i + k).FormulaR1C1 = "=IFERROR(FIND(""Chaud Seul"",RC[-11],1),"""")"
x = Feuil1.Range("AB" & i + k).Value
If Feuil1.Range("AB" & i + k) <> "" Then
Feuil1.Cells(i + k, "Q").Characters(Start:=x, Length:=10).Font.FontStyle = "Gras"
Feuil1.Cells(i + k, "Q").Characters(Start:=x, Length:=10).Font.Color = RGB(192, 0, 0)
End If
Feuil1.Range("AB" & i + k).ClearContents
k = 10
Feuil1.Range("AB" & i + k).FormulaR1C1 = "=IFERROR(FIND(""Chaud Seul"",RC[-19],1),"""")"
x = Feuil1.Range("AB" & i + k).Value
If Feuil1.Range("AB" & i + k) <> "" Then
Feuil1.Cells(i + k, "I").Characters(Start:=x, Length:=10).Font.FontStyle = "Gras"
Feuil1.Cells(i + k, "I").Characters(Start:=x, Length:=10).Font.Color = RGB(192, 0, 0)
End If
Feuil1.Range("AB" & i + k).ClearContents
k = 11
Feuil1.Range("AB" & i + k).FormulaR1C1 = "=IFERROR(FIND(""Chaud Seul"",RC[-19],1),"""")"
x = Feuil1.Range("AB" & i + k).Value
If Feuil1.Range("AB" & i + k) <> "" Then
Feuil1.Cells(i + k, "I").Characters(Start:=x, Length:=10).Font.FontStyle = "Gras"
Feuil1.Cells(i + k, "I").Characters(Start:=x, Length:=10).Font.Color = RGB(192, 0, 0)
End If
Feuil1.Range("AB" & i + k).ClearContents
End Sub