Dim
lngLetzteZeile
As
Long
Dim
lngLetzteSpalte
As
Long
Dim
LastFilledCell
As
Range
With
Sheets(
"1A Fuchs tobi"
).Range(
"L2:AO40"
)
Set
LastFilledCell = .Find(What:=
"*"
, _
After:=.Cells(1), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=
False
)
Do
While
LastFilledCell.Value = 0
Set
LastFilledCell = .FindPrevious(After:=LastFilledCell)
If
LastFilledCell.Address = .Cells(1).Address
Then
Exit
Do
Loop
lngLetzteZeile = LastFilledCell.Row
Set
LastFilledCell = .Find(What:=
"*"
, _
After:=.Cells(1), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious, _
MatchCase:=
False
)
Do
While
LastFilledCell.Value = 0
Set
LastFilledCell = .FindPrevious(After:=LastFilledCell)
If
LastFilledCell.Address = .Cells(1).Address
Then
Exit
Do
Loop
lngLetzteSpalte = LastFilledCell.Column
End
With