Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Can't test Range for Nothing

Public Sub testNullRange
Dim rRange As Range
Set rRange = Nothing ' yes, in debugger
If IsNull( rRange ) Then _
MsgBox "DOESN'T COME HERE"
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Can't test Range for Nothing

Don't use IsNull. Instead, use Is Nothing.

Dim rRange As Range
Set rRange = Nothing ' yes, in debugger
If rRange Is Nothing Then
MsgBox "rRange is Nothing"
End If



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Peter Chatterton" wrote in message
...
Public Sub testNullRange
Dim rRange As Range
Set rRange = Nothing ' yes, in debugger
If IsNull( rRange ) Then _
MsgBox "DOESN'T COME HERE"
End Sub




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can't test Range for Nothing

Try: If rRange Is Nothing Then

Ebbe

"Peter Chatterton" skrev i en meddelelse
...
Public Sub testNullRange
Dim rRange As Range
Set rRange = Nothing ' yes, in debugger
If IsNull( rRange ) Then _
MsgBox "DOESN'T COME HERE"
End Sub




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Can't test Range for Nothing

Thanks guys.

Peter

"Ebbe" k wrote in message
...
Try: If rRange Is Nothing Then

Ebbe

"Peter Chatterton" skrev i en meddelelse
...
Public Sub testNullRange
Dim rRange As Range
Set rRange = Nothing ' yes, in debugger
If IsNull( rRange ) Then _
MsgBox "DOESN'T COME HERE"
End Sub






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I test for nulls within a range without specifying each ce Houston Excel Discussion (Misc queries) 2 March 25th 10 05:50 PM
Test within a range? JC Excel Worksheet Functions 3 May 25th 07 03:41 AM
How I set up as logical test if my range has to be >=2 but <5 nsnjlacm Excel Discussion (Misc queries) 2 May 7th 05 08:04 PM
== How to test if a range var contains nothing hcova[_2_] Excel Programming 3 October 25th 04 10:08 PM
Test if Cell is within Range (name) goepf[_6_] Excel Programming 2 December 3rd 03 03:26 PM


All times are GMT +1. The time now is 11:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"