Null, "null", vbNull, vbNullString, vbEmpty

  • Thread starter Thread starter jason.teen
  • Start date Start date
J

jason.teen

Hi,

if I am writing VBA code in MS EXCEL to insert 'nulls' into certain
cells,
so that when I import that into MS Access I can run queries with the
filter criteria such as

SELECT *
FROM blah
WHERE column Is Not Null

Then which Null do i use?

cell.Value = Null ?
cell.Value = "Null" ?
cell.Value = vbNull ?
cell.Value = vbNullString ?
cell.Value = vbEmpty ?


I'm all nulled crazy ...hehe. :)
 
Excel cells can't afaik contain NULL. They will be either zero or an empty
string (which behaves like zero in Excel's calculations).

HTH. Best wishes Harald
 
I don't speak the Access or the SQL, but in VBA these are almost equivalent:

cell.value = ""
cell.clearcontents

About the only time I've noticed a difference is when I'm dealing with merged
cells (yech!!!).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top