```
Sub BigRect()
'returns the largest unoccupied rectangle with "Dest" as upper-left cell
'Make a pass through each row to get a largest rectanglar candidate
Const iMaxRows = 999999, iMaxColumns = 999999 ' the desired 7,4
Dim s As String, s2 As String, rng As Range
Dim i As Long, j As Long, iWinRow As Long, iWinCol As Long
Dim iR1 As Long, iC1 As Long, iR2 As Long, iC2 As Long
Dim iCount As Long, iWinCount As Long
Set rng = Range("dest")
If rng.Formula <> "" Then MsgBox "Dest nonempty": Exit Sub
iR1 = rng.Row
iC1 = rng.Column
iR2 = iR1 + iMaxRows - 1
iC2 = iC1 + iMaxColumns - 1
i = rng.End(xlDown).Row
j = rng.End(xlToRight).Column
If iR2 > i Then iR2 = i
If iC2 > j Then iC2 = j
For i = iR1 To iR2
Application.StatusBar = "row " & i
For j = iC1 To iC2
If ActiveSheet.Cells(i, j).Formula <> "" Then
iC2 = j - 1
Exit For
End If
Next j
iCount = (i - iR1 + 1) * (j - iC1)
If iCount > iWinCount Then
iWinRow = i: iWinCol = iC2: iWinCount = iCount
End If
Next i
s = Mid(rng.Address, 2, InStr(2, rng.Address, "$") - 2)
Set rng = rng.Offset(0, iWinCol - iC1)
s2 = Mid(rng.Address, 2, InStr(2, rng.Address, "$") - 2)
MsgBox "Biggest range is " & s & iR1 & ":" & s2 & iWinRow & _
vbCrLf & "(" & iWinCount & " cells)"
Set rng = Nothing
Application.StatusBar = ""
End Sub
```