Option
Explicit
Public
Sub
ColourSwitch()
Dim
lngAkt_Zeile
As
Long
, lngAkt_Spalte
As
Long
Dim
strStartSpalte
As
String
, strEndeSpalte
As
String
Dim
strBereich
As
String
Dim
lngRot
As
Long
, lngTuerkis
As
Long
, lngGelb
As
Long
Dim
lngHellgruen
As
Long
, lngRosa
As
Long
, lngDefault
As
Long
strStartSpalte =
"A"
strEndeSpalte =
"Z"
lngRot = &HFF&
lngTuerkis = &HFFFF00
lngGelb = &HFFFF&
lngHellgruen = &HFF00&
lngRosa = &HFF00FF
lngDefault = xlPatternNone
lngAkt_Zeile = ActiveCell.Row
lngAkt_Spalte = ActiveCell.Column
strBereich = strStartSpalte & lngAkt_Zeile &
":"
& strEndeSpalte & lngAkt_Zeile
With
Range(strBereich).Interior
Select
Case
.Color
Case
Is
= lngDefault: .Color = lngTuerkis
Case
Is
= lngTuerkis: .Color = lngRot
Case
Is
= lngRot: .Color = lngGelb
Case
Is
= lngGelb: .Color = lngHellgruen
Case
Is
= lngHellgruen: .Color = lngRosa
Case
Else
: .Color = lngTuerkis
End
Select
.Pattern = xlSolid
End
With
End
Sub