Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Empty cell Identified
What code do I use to test a cell for its content? I want to know if the cell is empty or contains text or values. Is "" produced by a formula the same as Blank or empty? Thanks!! -- Brian Matlack ------------------------------------------------------------------------ Brian Matlack's Profile: http://www.excelforum.com/member.php...fo&userid=3508 View this thread: http://www.excelforum.com/showthread...hreadid=479098 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Empty cell Identified
Nope, a cell that contains a formula that returns "" isn't empty--it has that
formula in it: You can check: With ActiveSheet .Range("a1").Formula = "=""""" 'then try '.range("a1").clearcontents MsgBox IsEmpty(.Range("a1")) & vbLf & _ CBool(.Range("a1").Value = "") & vbLf & _ CBool(Trim(.Range("a1").Value = "")) End With And just to muddy the waters...A cell that had a formula that returned "" and was converted to values isn't empty, either! Brian Matlack wrote: What code do I use to test a cell for its content? I want to know if the cell is empty or contains text or values. Is "" produced by a formula the same as Blank or empty? Thanks!! -- Brian Matlack ------------------------------------------------------------------------ Brian Matlack's Profile: http://www.excelforum.com/member.php...fo&userid=3508 View this thread: http://www.excelforum.com/showthread...hreadid=479098 -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Empty cell Identified
if isempty(activeCell) then
' its empty You can also look at Vartype -- Regards, Tom Ogilvy "Brian Matlack" wrote in message news:Brian.Matlack.1xgo6g_1130249129.0561@excelfor um-nospam.com... What code do I use to test a cell for its content? I want to know if the cell is empty or contains text or values. Is "" produced by a formula the same as Blank or empty? Thanks!! -- Brian Matlack ------------------------------------------------------------------------ Brian Matlack's Profile: http://www.excelforum.com/member.php...fo&userid=3508 View this thread: http://www.excelforum.com/showthread...hreadid=479098 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to compare worksheets so differences are identified | Excel Worksheet Functions | |||
Each client to be identified into segment | Excel Discussion (Misc queries) | |||
why a reference to an empty cell is not considered empty | Excel Discussion (Misc queries) | |||
can a cell be identified as a drop down box without moving the cur | Excel Discussion (Misc queries) | |||
Removing Lines Identified by Autofilter | Excel Programming |