View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Check null for range objects

Hi Kaon.


If rng is Nothing Then
' do something
End if

or, more usually, the reverse condition:

If not rng is nothing Then
' do something
End if
--

---
Regards,
Norman



"kaon " wrote in message
...
With ActiveSheet.AutoFilter.Range
On Error Resume Next
Set rng = .Offset(1, 0).Resize(.Rows.Count - 1,
1).SpecialCells(xlCellTypeVisible)
Set rng2 =
rng.Columns(17).SpecialCells(xlCellTypeVisible)
End with

Hi all,

How can I check if rng and rng2 are null?

I used isNull() and isEmpty(), but both give the wrong answer to me.
:(

Thanks.


---
Message posted from http://www.ExcelForum.com/