dani9
07-21-2011, 03:53 AM
Hey
how can I make this shorter? it is really bothering me, it takes to much space in the code...
If Sheets("ORMC Performance Report").Range("A2") = True And _
Sheets("ORMC Performance odd").Range("E24").Interior.Color <> RGB(255, 255, 255) Then
Sheets("ORMC Performance Report").Range("F24").Interior.ColorIndex = _
Sheets("ORMC Performance odd").Range("E24").Interior.ColorIndex
End If
If Sheets("ORMC Performance Report").Range("A2") = False And _
Sheets("ORMC Performance even").Range("E24").Interior.Color <> RGB(255, 255, 255) Then
Sheets("ORMC Performance Report").Range("F24").Interior.ColorIndex _
= Sheets("ORMC Performance even").Range("E24").Interior.ColorIndex
End If
If Sheets("ORMC Performance Report").Range("A2") = True And _
Sheets("ORMC Performance odd").Range("G24").Interior.Color <> RGB(255, 255, 255) Then
Sheets("ORMC Performance Report").Range("H24").Interior.ColorIndex = _
Sheets("ORMC Performance odd").Range("G24").Interior.ColorIndex
End If
If Sheets("ORMC Performance Report").Range("A2") = False And _
Sheets("ORMC Performance even").Range("G24").Interior.Color <> RGB(255, 255, 255) Then
Sheets("ORMC Performance Report").Range("H24").Interior.ColorIndex _
= Sheets("ORMC Performance even").Range("G24").Interior.ColorIndex
End If
If Sheets("ORMC Performance Report").Range("A2") = True And _
Sheets("ORMC Performance even").Range("E24").Interior.Color <> RGB(255, 255, 255) Then
Sheets("ORMC Performance Report").Range("G24").Interior.ColorIndex = _
Sheets("ORMC Performance even").Range("E24").Interior.ColorIndex
End If
If Sheets("ORMC Performance Report").Range("A2") = False And _
Sheets("ORMC Performance odd").Range("E24").Interior.Color <> RGB(255, 255, 255) Then
Sheets("ORMC Performance Report").Range("G24").Interior.ColorIndex _
= Sheets("ORMC Performance odd").Range("E24").Interior.ColorIndex
End If
If Sheets("ORMC Performance Report").Range("A2") = True And _
Sheets("ORMC Performance even").Range("G24").Interior.Color <> RGB(255, 255, 255) Then
Sheets("ORMC Performance Report").Range("I24").Interior.ColorIndex = _
Sheets("ORMC Performance even").Range("G24").Interior.ColorIndex
End If
If Sheets("ORMC Performance Report").Range("A2") = False And _
Sheets("ORMC Performance odd").Range("G24").Interior.Color <> RGB(255, 255, 255) Then
Sheets("ORMC Performance Report").Range("I24").Interior.ColorIndex _
= Sheets("ORMC Performance odd").Range("G24").Interior.ColorIndex
End If
thanks in advance for helping me
how can I make this shorter? it is really bothering me, it takes to much space in the code...
If Sheets("ORMC Performance Report").Range("A2") = True And _
Sheets("ORMC Performance odd").Range("E24").Interior.Color <> RGB(255, 255, 255) Then
Sheets("ORMC Performance Report").Range("F24").Interior.ColorIndex = _
Sheets("ORMC Performance odd").Range("E24").Interior.ColorIndex
End If
If Sheets("ORMC Performance Report").Range("A2") = False And _
Sheets("ORMC Performance even").Range("E24").Interior.Color <> RGB(255, 255, 255) Then
Sheets("ORMC Performance Report").Range("F24").Interior.ColorIndex _
= Sheets("ORMC Performance even").Range("E24").Interior.ColorIndex
End If
If Sheets("ORMC Performance Report").Range("A2") = True And _
Sheets("ORMC Performance odd").Range("G24").Interior.Color <> RGB(255, 255, 255) Then
Sheets("ORMC Performance Report").Range("H24").Interior.ColorIndex = _
Sheets("ORMC Performance odd").Range("G24").Interior.ColorIndex
End If
If Sheets("ORMC Performance Report").Range("A2") = False And _
Sheets("ORMC Performance even").Range("G24").Interior.Color <> RGB(255, 255, 255) Then
Sheets("ORMC Performance Report").Range("H24").Interior.ColorIndex _
= Sheets("ORMC Performance even").Range("G24").Interior.ColorIndex
End If
If Sheets("ORMC Performance Report").Range("A2") = True And _
Sheets("ORMC Performance even").Range("E24").Interior.Color <> RGB(255, 255, 255) Then
Sheets("ORMC Performance Report").Range("G24").Interior.ColorIndex = _
Sheets("ORMC Performance even").Range("E24").Interior.ColorIndex
End If
If Sheets("ORMC Performance Report").Range("A2") = False And _
Sheets("ORMC Performance odd").Range("E24").Interior.Color <> RGB(255, 255, 255) Then
Sheets("ORMC Performance Report").Range("G24").Interior.ColorIndex _
= Sheets("ORMC Performance odd").Range("E24").Interior.ColorIndex
End If
If Sheets("ORMC Performance Report").Range("A2") = True And _
Sheets("ORMC Performance even").Range("G24").Interior.Color <> RGB(255, 255, 255) Then
Sheets("ORMC Performance Report").Range("I24").Interior.ColorIndex = _
Sheets("ORMC Performance even").Range("G24").Interior.ColorIndex
End If
If Sheets("ORMC Performance Report").Range("A2") = False And _
Sheets("ORMC Performance odd").Range("G24").Interior.Color <> RGB(255, 255, 255) Then
Sheets("ORMC Performance Report").Range("I24").Interior.ColorIndex _
= Sheets("ORMC Performance odd").Range("G24").Interior.ColorIndex
End If
thanks in advance for helping me