Private Sub Color_Station()
Dim iTxt1 As String, iTxt2 As String, iTxt3 As String, itxt4 As String, itxt5 As String, itxt6 As String, itxt7 As String, itxt8 As String, itxt9 As String, iTxt10 As String
Dim iName1 As Variant, iName2 As Variant, iName3 As Variant, iName4 As Variant, iName5 As Variant, iName6 As Variant, iName7 As Variant, iName8 As Variant, iName9 As Variant, iName10 As Variant
Dim anzahl As Long, a As Long
iTxt1 = "Select"
iTxt2 = "System"
iTxt3 = "Station"
itxt4 = "Eco"
itxt5 = "Back_"
itxt8 = "Distance"
itxt9 = "Profit"
iTxt10 = "Update"
' Anzahl = AzDES
anzahl = Worksheets("Data").Cells(2, 5).Value
If anzahl > 23 Then
anzahl = 23
End If
For a = 1 + Me.ScrollBar1.Value To anzahl + Me.ScrollBar1.Value
iName5 = itxt5 & a - Me.ScrollBar1.Value
If Me.Chk_Large.Value Then
If Ar_DBType(Worksheets("DES_Systemdata").Cells(1 + a, 10).Value, 3) = "L" Then
'------> System
iName2 = iTxt2 & a - Me.ScrollBar1.Value
Me.Controls(iName2).ForeColor = &HFFFFFF
'------> Station
iName3 = iTxt3 & a - Me.ScrollBar1.Value
Me.Controls(iName3).ForeColor = &HFFFFFF
'------> Economy
iName4 = itxt4 & a - Me.ScrollBar1.Value
Me.Controls(iName5).ForeColor = &HFFFFFF
'------> Distance
iName8 = itxt8 & a - Me.ScrollBar1.Value
Me.Controls(iName8).ForeColor = &HFFFFFF
'------> Discount
iName9 = itxt9 & a - Me.ScrollBar1.Value
Me.Controls(iName9).ForeColor = &HFFFFFF
'------> Update
iName10 = iTxt10 & a - Me.ScrollBar1.Value
Me.Controls(iName10).ForeColor = &HFFFFFF
If Worksheets("DES_Systemdata").Cells(1 + a, 1).Value = DES_StationID Then
Me.Controls(iName5).BackColor = TCE_Color
Me.Controls(iName2).ForeColor = &H0&
Me.Controls(iName3).ForeColor = &H0&
Me.Controls(iName4).ForeColor = &H0&
Me.Controls(iName8).ForeColor = &H0&
Me.Controls(iName9).ForeColor = &H0&
Me.Controls(iName10).ForeColor = &H0&
End If
Else
'------> System
iName2 = iTxt2 & a - Me.ScrollBar1.Value
Me.Controls(iName2).ForeColor = &H505050
'------> Station
iName3 = iTxt3 & a - Me.ScrollBar1.Value
Me.Controls(iName3).ForeColor = &H505050
'------> Economy
iName4 = itxt4 & a - Me.ScrollBar1.Value
Me.Controls(iName4).ForeColor = &H505050
'------> Distance
iName8 = itxt8 & a - Me.ScrollBar1.Value
Me.Controls(iName8).ForeColor = &H505050
'------> Discount
iName9 = itxt9 & a - Me.ScrollBar1.Value
Me.Controls(iName9).ForeColor = &H505050
'------> Update
iName10 = iTxt10 & a - Me.ScrollBar1.Value
Me.Controls(iName10).ForeColor = &H505050
If Worksheets("DES_Systemdata").Cells(1 + a, 1).Value = DES_StationID Then
Me.Controls(iName5).BackColor = TCE_Color
Me.Controls(iName2).ForeColor = &H0&
Me.Controls(iName3).ForeColor = &H0&
Me.Controls(iName4).ForeColor = &H0&
Me.Controls(iName8).ForeColor = &H0&
Me.Controls(iName9).ForeColor = &H0&
Me.Controls(iName10).ForeColor = &H0&
End If
End If
Else
'------> System
iName2 = iTxt2 & a - Me.ScrollBar1.Value
Me.Controls(iName2).ForeColor = &HFFFFFF
'------> Station
iName3 = iTxt3 & a - Me.ScrollBar1.Value
Me.Controls(iName3).ForeColor = &HFFFFFF
'------> Economy
iName4 = itxt4 & a - Me.ScrollBar1.Value
Me.Controls(iName4).ForeColor = &HFFFFFF
'------> Distance
iName8 = itxt8 & a - Me.ScrollBar1.Value
Me.Controls(iName8).ForeColor = &HFFFFFF
'------> Discount
iName9 = itxt9 & a - Me.ScrollBar1.Value
Me.Controls(iName9).ForeColor = &HFFFFFF
'------> Update
iName10 = iTxt10 & a - Me.ScrollBar1.Value
Me.Controls(iName10).ForeColor = &HFFFFFF
If Worksheets("DES_Systemdata").Cells(1 + a, 1).Value = DES_StationID Then
Me.Controls(iName5).BackColor = TCE_Color
Me.Controls(iName2).ForeColor = &H0&
Me.Controls(iName3).ForeColor = &H0&
Me.Controls(iName4).ForeColor = &H0&
Me.Controls(iName8).ForeColor = &H0&
Me.Controls(iName9).ForeColor = &H0&
Me.Controls(iName10).ForeColor = &H0&
End If
End If
Next a
End Sub