Private
Sub
worksheet_activate()
Worksheets(
"Jornal"
).ToogleButton1 =
False
Call
Schalter
End
Sub
Sub
Schalter()
ActiveSheet.Unprotect
Dim
Bereich
As
Range
Dim
Zelle
As
Range
Set
Bereich = Worksheets(
"Auftraege"
).Range(
"F2:F2000"
)
Worksheets(
"Jornal"
).ComboBox3.Clear
If
ToogleButton1 =
True
Then
For
Each
Zelle
In
Bereich
If
Zelle.Offset(0, -5).Value >= 1000
Then
If
Zelle.Offset(0, 1).Value = 1
Then
Worksheets(
"Jornal"
).ComboBox3.AddItem Zelle.Value
End
If
Next
Zelle
With
Worksheets(
"Jornal"
).ComboBox3
.AddItem
""
.MatchRequired =
True
End
With
Else
For
Each
Zelle
In
Bereich
If
Zelle.Offset(0, -5).Value >= 1
Then
If
Zelle.Offset(0, -5).Value < 1000
Then
If
Zelle.Offset(0, 1).Value = 1
Then
Worksheets(
"Jornal"
).ComboBox3.AddItem Zelle.Value
End
If
End
If
Next
Zelle
With
Worksheets(
"Jornal"
).ComboBox3
.AddItem
""
.MatchRequired =
True
End
With
End
If
ActiveSheet.Protect
End
Sub