![]() |
Check null for range objects
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 |
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/ |
Check null for range objects
|
All times are GMT +1. The time now is 02:58 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com