View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Null value in excel

A cell can have a Null value, but StrComp handles this situation.
Nuill is less that any other value, so

Debug.Print StrComp(Range("A1").Value, Range("A2").Value)

will reutrn -1 is A1 is null (and A2 is not).

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
The San Diego Project Group, LLC
(email is on the web site)
USA Central Daylight Time (-5:00 GMT)


On Wed, 24 Sep 2008 13:14:00 -0700, "Bob" wrote:

Hi everyone:

I am using the Strcomp to compare the value of two cells in excel. I was
wondering is it possible for a cell to ever be Null? In other words, do I
need to worry about it in the returned value of Strcomp, or just look
for -1, 0, 1. Thanks for all your help.

Bob