Sub
Variablenauswahl()
Dim
STARTZEIT
As
String
Dim
ENDZEIT
As
String
Dim
ANTW_STARTZEIT
As
Long
Dim
ANTW_ENDZEIT
As
Long
Dim
NUMMERA
As
Long
Dim
NUMMERB
As
Long
STARTZEIT = InputBox(
"Wählen Sie die Startzeitpunkt"
& Chr(10) &
"(Eingabe im Format: hh:mm:ss)"
,
"Stationärer Zeitraum"
)
ENDZEIT = InputBox(
"Wählen Sie die Endzeitpunkt"
& Chr(10) &
"(Eingabe im Format: hh:mm:ss)"
,
"Stationärer Zeitraum"
)
ActiveCell.Replace What:=STARTZEIT, Replacement:=STARTZEIT, LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=
False
, SearchFormat:=
False
, _
ReplaceFormat:=
False
Cells.Find(What:=STARTZEIT, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=
False
, SearchFormat:=
False
).Activate
NUMMERA = ActiveCell.Row
ActiveCell.Replace What:=ENDZEIT, Replacement:=ENDZEIT, LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=
False
, SearchFormat:=
False
, _
ReplaceFormat:=
False
Cells.Find(What:=ENDZEIT, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=
False
, SearchFormat:=
False
).Activate
NUMMERB = ActiveCell.Row
Cells(5, 2) =
"=Average(B"
& NUMMERA &
": B"
& NUMMERB &
")"
Cells(5, 3) =
"=Average(C"
& NUMMERA &
": C"
& NUMMERB &
")"
End
Sub