Gruppe
Extern
Problem
Unterhalb eines benutzten Tabellenblattbereiches soll eine dynamische Linie gezogen werden.
StandardModule: Modul1
Function RealLastCell() As Variant
Dim rng As range
Dim arr(1 To 2)
Dim Row%, Col%
Set rng = range("H25")
Row = rng.Row
Do While Application.CountA(Rows(Row)) = 0 And Row <> 1
Row = Row - 1
Loop
arr(1) = Row
Col = rng.Column
Do While Application.CountA(Columns(Col)) = 0 And Col <> 1
Col = Col - 1
Loop
arr(2) = Col
RealLastCell = arr
End Function
Function GetRow() As Integer
Dim arr As Variant
arr = RealLastCell()
GetRow = arr(1)
End Function
Function GetColumn() As Integer
Dim arr As Variant
arr = RealLastCell()
GetColumn = arr(2)
End Function