Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using Nothing and Null
What is the difference between Nothing (if Range("A1") is Nothing then ...)
and Null (if IsEmpty(Range("A1") then ...)? What is better to use with ranges (seems both keywords work)? Thanks in advance, Mike510 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using Nothing and Null
I think this is the general idea.
Nothing applies to an object Sub Dim rngCell as range msgbox (rngCell is nothing) 'should return true Set rngCell = Range("A1") msgbox (rngcell is nothing) 'should return false set rngCell = Nothing 'clears the object IsEmpty applies to a variable Dim vTemp as variant if IsEmpty(vTemp) then ' would be true vTemp = "Something" if IsEmpty(vTemp) then ' would be false Hope that helps, Robin Hammond www.enhanceddatasystems.com Check out our XspandXL add-in "Mikhail" wrote in message ... What is the difference between Nothing (if Range("A1") is Nothing then ....) and Null (if IsEmpty(Range("A1") then ...)? What is better to use with ranges (seems both keywords work)? Thanks in advance, Mike510 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
if is null | Excel Discussion (Misc queries) | |||
Failed to save table attributes of (null) into (null). | Excel Discussion (Misc queries) | |||
COUNTIF says Null = Blank but Blank < Null | Excel Worksheet Functions | |||
cell value based on null/not null in another cell | Excel Worksheet Functions | |||
When value is NOT Null | Excel Worksheet Functions |