Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Curious IsNull test

Why, when my code goes through this segment, is neither message box
displayed?

If IsNull(test) Then
MsgBox "Test is now null"
Else
MsgBox "<" & test.Value & ""
End If

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Curious IsNull test

What data type is 'test'?

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


"Tim" wrote in message
oups.com...
Why, when my code goes through this segment, is neither message
box
displayed?

If IsNull(test) Then
MsgBox "Test is now null"
Else
MsgBox "<" & test.Value & ""
End If



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Curious IsNull test

Hi Tim

What is test? Could it be that you have an errorhandler that is trapping an
error and therefore skipping one of the message boxes?

If test is a range then it will never be null. It is Nothing until you set
it and if it is set to a range which contains no data then it's Value
property is Empty.

Hope this helps
Rowan

"Tim" wrote:

Why, when my code goes through this segment, is neither message box
displayed?

If IsNull(test) Then
MsgBox "Test is now null"
Else
MsgBox "<" & test.Value & ""
End If


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Curious IsNull test

Dim cntNew, test As MSForms.Control

I have discovered part of the problem is that an error handler grabs
control. Let me just investigate this information futher.

Much thanks,
-Tim

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Curious IsNull test

Ok. Question answered. Many thanks.

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
Test for null - insert a row if isnull Bonnie Excel Discussion (Misc queries) 3 July 10th 07 09:20 PM
Just curious famdamly Excel Discussion (Misc queries) 2 December 7th 05 01:33 AM
problem using isnull() to check a value in ADODB.Recordset tilmP Excel Programming 0 January 18th 05 07:42 AM
ISNULL function - can't find it KitKat Excel Worksheet Functions 6 December 3rd 04 04:55 AM
Just Curious Mike Fogleman Excel Programming 7 September 30th 04 08:04 AM


All times are GMT +1. The time now is 04:35 PM.

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"