View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default check for non-empty cells outside of a certain range

Sub GetRealLastCell()
Dim RealLastRow As Long
Dim RealLastColumn As Long
On Error Resume Next
RealLastRow = _
Cells.Find("*", Range("A1"), , , xlByRows, xlPrevious).Row
RealLastColumn = _
Cells.Find("*", Range("A1"), , , xlByColumns, xlPrevious).Column
if RealLastRow 50 or RealLastColumn 50 then
msgbox "entries outside range"
else
msgbox "no entries outside range"
end if
End Sub

--
Regards,
Tom Ogilvy


"Abe" wrote:

If I have a range of cells, say Range(Cells(1,1), Cells(50,50)), what
is the easiest way to check that all the other cells on that sheet have
no formulas or constants in them?

Thanks in advance,

Abe