Option
Explicit
Sub
Auswertung()
Application.ScreenUpdating =
False
Dim
p
As
Integer
Dim
st
As
Integer
Dim
s
As
Integer
Dim
e
As
Integer
Dim
w
As
Integer
Dim
Start
As
Date
Dim
Ende
As
Date
Dim
a
As
Integer
Dim
i
As
Integer
Dim
v
As
Integer
p = 4
st = 1
s = 9
e = 11
w = 3
ThisWorkbook.Worksheets(
"Industrie"
).Activate
Start = InputBox(
"Bitte Start des Auswertungszeitraumes eingeben im Datumsformat TT.MM.JJJJ:"
)
Ende = InputBox(
"Bitte Ende des Auswertungszeitraumes eingeben im Datumsformat TT.MM.JJJJ:"
)
Dim
Status
Status = Worksheets(
"Industrie Auswertung"
).Range(
"E5"
).Value
a = 0
For
i = p
To
Cells(Rows.Count, st).
End
(xlUp).Row
If
Cells(i, s) >= Start
And
Cells(i, e) <= Ende
v = v + Cells(i, w).Value
a = a + 1
End
If
Next
Worksheets(
"Industrie Auswertung"
).Range(
"C5"
).Value = Start
Worksheets(
"Industrie Auswertung"
).Range(
"D5"
).Value = Ende
Worksheets(
"Industrie Auswertung"
).Range(
"E5"
).Value = Status
Worksheets(
"Industrie Auswertung"
).Range(
"F5"
).Value = a
Worksheets(
"Industrie Auswertung"
).Range(
"G5"
).Value = v
MsgBox
"Für den Projektstatus "
& Status &
" beträgt im gewählten Zeitraum vom "
& Start &
" bis "
& Ende &
" die Anzahl Projekte "
& a &
" und die Anzahl Projekttage "
& v &
"."
ThisWorkbook.Worksheets(
"Industrie Auswertung"
).Activate
Cells(1, 1).
Select
Application.ScreenUpdating =
True
End
Sub