i defined an area to be selected below my case if the cell below my case is not empty,
but the selected area reaches too far
how do i count the number of rows until it reaches an empty cell below my case?
but the selected area reaches too far
how do i count the number of rows until it reaches an empty cell below my case?
VBA Code:
Sub DefineArea()
Dim vL As Range, vE As Range
For Each vL In Range("A1", Range("A" & Rows.Count).End(xlUp))
Select Case vL.Value
Case "Total Ertrag"
If Not IsEmpty(vL.Offset(1).Value) Then
'vL.Offset(1).Range("A1:A$" & Range("A1").End(xlDown).Row).EntireRow.Select ?
End If
End Select
Next vL
End Sub