Sub
do()
Dim
intRow
As
Integer
, intLastRow
As
Integer
Dim
gesamt
As
Worksheet
Dim
y
As
Long
, lngZeilen
As
Long
, lngZeilen2
As
Long
, y2
As
Long
Dim
wkb
As
Workbook
Dim
textboxDat
As
Date
Dim
datum
As
Date
Dim
zeit
As
String
Dim
datum2
As
Date
Dim
zeit2
As
String
textboxDat = TextBox3.Value
Set
wkb = Workbooks.Open(
"C:\Dokumente und Einstellungen\P325130\Desktop\kopie Neuwagen\Neuwagenmanagement.xls"
)
Set
gesamt = wkb.Sheets(
"Neuwagen"
)
lngZeilen = gesamt.Cells(gesamt.Rows.Count, 1).
End
(xlUp).Row
For
y = 2
To
lngZeilen
wkb.Activate
Sheets(
"Neuwagen"
).Activate
datum = Sheets(
"Neuwagen"
).Cells(y, 13).Value
zeit = Sheets(
"Neuwagen"
).Cells(y, 14).Text
If
datum = textboxDat
And
zeit =
"9:00"
Then
Label120.Caption = Cells(y, 5).Value
Label121.Caption = Cells(y, 12).Value
Label208.Caption = Cells(y, 1).Value
ElseIf
datum = textboxDat
And
zeit =
"9:15"
Then
Label188.Caption = Cells(y, 5).Value
Label190.Caption = Cells(y, 12).Value
Label209.Caption = Cells(y, 1).Value
Else
End
If
Next
y
For
y = 2
To
lngZeilen
wkb.Activate
Sheets(
"Neuwagen"
).Activate
datum2 = Sheets(
"Neuwagen"
).Cells(y, 32).Value
zeit2 = Sheets(
"Neuwagen"
).Cells(y, 33).Text
If
datum2 = textboxDat
And
zeit2 =
"9:00"
Then
Label300.Caption = Cells(y, 31).Value
Label313.Caption = Cells(y, 29).Value
Label362.Caption = Cells(y, 30).Value
ElseIf
datum2 = textboxDat
And
zeit2 =
"9:15"
Then
Label299.Caption = Cells(y, 31).Value
Label312.Caption = Cells(y, 29).Value
Label325.Caption = Cells(y, 30).Value
Else
End
If
Next
y