Option
Explicit
Sub
Aufgabe1()
Dim
rng
As
Excel.Range
Dim
nz
As
Long
Dim
i
As
Long
Set
rng = Cells(Rows.Count,
"A"
).
End
(xlUp)
Set
rng = Range(
"A1"
, rng)
For
i = 1
To
rng.Cells.Count
If
rng.Cells(i).Text =
""
Then
nz = nz + 1
Else
nz = 0
End
If
If
nz = 3
Then
Exit
For
Next
If
nz = 3
Then
MsgBox
"Auf Zelle "
& rng.Cells(i - 3).Address(
False
,
False
) &
" folgen die ersten drei Leerzeilen."
Else
MsgBox
"Es wurden keine drei Leerzeilen in Folge gefunden."
End
If
End
Sub
Sub
Aufgabe3(
ByVal
Arg1
As
Long
,
ByVal
Arg2
As
Long
,
ByVal
Arg3
As
Long
,
ByRef
Arg4
As
Long
)
If
Arg1 > Arg2
And
Arg1 > Arg3
Then
Arg4 = 1
ElseIf
Arg2 > Arg1
And
Arg2 > Arg3
Then
Arg4 = 2
Else
Arg4 = 3
End
If
End
Sub