Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 252
Default Null exist in Excel

Hi all,

Before a cell is filled, is it Null or "" ? and how tell a cell filled by a
formula ?


Clara
thank you so much for your help
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Null exist in Excel

Clara,

I think an unused cell would be a null string value ("") but not NULL.
Created a new workbook, then in the Immediate window:

?ISNULL(sheet1.Range("A1").Value)
False

?sheet1.Range("A1").Value=""
True

To tell if a cell has a formula, check the HasFormula property. For example,
I placed =A1 in B1. then in the Immediate window:

?sheet1.Range("B1").HasFormula
True



--
Hope that helps.

Vergel Adriano


"clara" wrote:

Hi all,

Before a cell is filled, is it Null or "" ? and how tell a cell filled by a
formula ?


Clara
thank you so much for your help

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Null exist in Excel

I'd use:

dim myCell as range
set mycell = somecell 'single cell only
if isempty(mycell.value) then
'nothing, not even a formula
else
'something
end if

If you check
if mycell.value = "" then
It could contain a formula that evaluates to ""
(=If(a1=7,"ok","")

And you can test to see if a cell contains a formula with:

if mycell.hasformula then



clara wrote:

Hi all,

Before a cell is filled, is it Null or "" ? and how tell a cell filled by a
formula ?

Clara
thank you so much for your help


--

Dave Peterson
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
Failed to save table attributes of (null) into (null). Luca Brasi Excel Discussion (Misc queries) 2 February 4th 09 04:30 PM
Null, "null", vbNull, vbNullString, vbEmpty [email protected] Excel Programming 2 July 25th 06 01:28 PM
Copy Worksheet to a new Workbook creating if it doesn't exist and add more Worksheets if it does exist [email protected] Excel Programming 4 June 18th 06 06:08 PM
Command Line. How to tell to XL : If the xls file exist : Open it, if it does not exist : Create it. Tintin92 Excel Programming 3 March 11th 06 06:45 PM
excel macro looking for file that doesn't exist regisphilbin Excel Programming 2 September 26th 03 03:37 AM


All times are GMT +1. The time now is 01:47 PM.

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

About Us

"It's about Microsoft Excel"